Allegro利用Skill语言实现根据NET获取同网络下所有过孔的坐标信息

2023-03-21 13:49:51 浏览数 (1)

代码如下:

代码语言:javascript复制
defun(GetViaCoordinate (NetName)
axlClearSelSet()
axlSetFindFilter( ?enabled (list "nets" ) ?onButtons (list "nets"))
;p = axlSelectByName("NET" "DDR_B4420_MDQ0" t)
p = axlSelectByName("NET" NetName t)
parentGroups = car(p)->parentGroups
branches = car(p)->branches
branches_length = length(branches)
name = car(p)->name;网络名
nBranches = car(p)->nBranches;分支数
objType = car(p)->objType;NET
readOnly = car(p)->readOnly;t或nil
prop = car(p)->prop;逻辑路径
pinpair = car(p)->pinpair
ratT = car(p)->ratT
ratsnest= car(p)->ratsnest
ratsnestOn = car(p)->ratsnestOn;t或nil
bus = car(p)->bus
diffpair = car(p)->diffpair
xnet = car(p)->xnet
scheduleLocked= car(p)->scheduleLocked
isBundled = car(p)->isBundled
rpd = car(p)->rpd
unconnected = car(p)->unconnected
unplaced= car(p)->unplaced
;defvar(via_list)
let((my_via_table)
via_table = makeTable("table")
for(i 0 nBranches-1
children = nth(i branches)->children
children_len = length(children)
axlUIWPrint(nil "children_len=%d" children_len)
for(j 0 children_len-1
length_via_table=length(via_table) 
axlUIWPrint(nil "length_via_table=%d" length_via_table) 
if(nth(j children)->name=="VIA8D16"
via_table[length_via_table] = nth(j children)->xy
)

)
)
my_via_table = via_table
)

)

使用用法:

1. 新建*.il,复制上述代码进去。

2. Allegro界面执行skill load("*.il的完整名")

3. Allegro命令界面输入skill,并输入:ViaCoord = GetViaCoordinate("DDR_B4420_MDQ0"),其中DDR_B4420_MDQ0就是网络名,那么ViaCoord[0],ViaCoord[1]...就包含了这些过孔的坐标。

0 人点赞