|
回复 5# oday
非常感谢!下面的是我查找symbol的代码.最开始的时候总是不知道各种dbid对应的属性有哪些,还有没弄清楚axlSelectByName函数的返回值是什么,结果
怎样都得不到symbo的属性,后来仔细看了algroskill.pdf才知道.
我最开始的时候是这样用的:
SymbolId= axlSelectByName("REFDES" sSymbolName)
然后判断SymbolId->isMirrored 是否为t,结果总是nil,后来才发现axlSelectByName返回的是list,要用car函数取出里面的dbid才可以.
之后我会再修改zoom部分的代码.
procedure( ex_FindSymbol(bHighMode sSymbolName)
if(sSymbolName == "" then
printf("Please type the symbol name")
return(nil))
SymbolList = axlSelectByName("REFDES" sSymbolName)
SymbolId = car(SymbolList)
if(SymbolId != nil then
if(SymbolId->isMirrored then
ex_layer_bot()
else
ex_layer_top())
printf("Find Symbol %s\n" sSymbolName)
axlZoomToDbid(SymbolId t)
axlHighlightObject(SymbolId bHighMode)
else
printf("%s is not found" sSymbolName)
);if
);procedure
defun( ex_layer_top ()
;layerlist=axlGetParam("paramLayerGroup:etch")->groupMembers
;CurrentSel = axlGetSelSet()
axlVisibleDesign(nil)
axlVisibleLayer("board geometry/outline" t)
axlVisibleLayer("package keepin/all" t)
axlVisibleLayer("package geometry/silkscreen_top" t)
sTemp = strcat("pin/" axlConductorTopLayer())
axlVisibleLayer(sTemp t)
sTemp = strcat("etch/" axlConductorTopLayer())
axlVisibleLayer(sTemp t)
sTemp = strcat("via class/" axlConductorTopLayer())
axlVisibleLayer(sTemp t)
axlVisibleUpdate(t)
;axlHighlightObject(CurrentSel nil)
)
defun( ex_layer_bot ()
axlVisibleDesign(nil)
axlVisibleLayer("board geometry/outline" t)
axlVisibleLayer("package keepin/all" t)
axlVisibleLayer("package geometry/silkscreen_bottom" t)
sTemp = strcat("pin/" axlConductorBottomLayer())
axlVisibleLayer(sTemp t)
sTemp = strcat("etch/" axlConductorBottomLayer())
axlVisibleLayer(sTemp t)
sTemp = strcat("via class/" axlConductorBottomLayer())
axlVisibleLayer(sTemp t)
axlVisibleUpdate(t)
)
贴一下symbol的所有属性
Table 2-17 Symbol Attributes
Attribute Name Type Description
children l_dbid/nil List of figures other than pins making up symbol
component dbid Component owner of symbol
definition dbid Symbol definition
isMirrored t/nil t = symbol is mirrored
mirrorType string Type of mirror.
name string Symbol name
objType string Type of object, in this case "symbol"
parent dbid Design (no other parent possible for symbols)
pins l_dbid/nil List of pins
refdes string/nil Reference designator
rotation float Symbol rotation |
|