-
Notifications
You must be signed in to change notification settings - Fork 108
/
Copy pathdbtest.py
55 lines (45 loc) · 1.21 KB
/
dbtest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# -*- coding: utf-8 -*-
import ScriptEnv
ScriptEnv.Initialize("Ansoft.ElectronicsDesktop")
oDesktop.RestoreWindow()
oDesktop.ClearMessages("","",2)
import clr
clr.AddReference('Ansys.Ansoft.Edb')
import Ansys.Ansoft.Edb as edb
#------------------------------------------------------
db = edb.Database.Open('d:/demo/Project3.aedb',False)
try:
cell = list(db.TopCircuitCells)
layout = cell[0].GetLayout()
AddWarningMessage(cell[0].GetName())
for i in layout.PadstackInstances:
i.SetLayerRange('top','bot')
n+=1
except:
AddErrorMessage('Excrption!!')
finally:
db.Save()
db.Close()
'''取得net名稱
db = edb.Database.Open('d:/demo/Project3.aedb',False)
try:
cell = list(db.TopCircuitCells)
layout = cell[0].GetLayout()
for net in layout.Nets:
AddWarningMessage(net.GetName())
except:
AddErrorMessage('Excrption!!')
finally:
db.Close()
'''
'''取得aedb cell名稱
db = edb.Database.Open('d:/demo/Project3.aedb',False)
try:
cell = list(db.TopCircuitCells)
for i in cell:
AddWarningMessage(i.GetName())
except:
AddErrorMessage('Excrption!!')
finally:
db.Close()
'''