|
发表于 2018-6-28 21:13:27
|
显示全部楼层
回复 1# rebecca2018
Sorry no Chinese input at this computer.
Finally understand the purpose of your code. To be honest, I have not seen this kind of structure before: procedure inside procedure. Theoretically this can work, but you may end up with some issue due to different user cases.
I modify your code a little bit, have not really try this code yet, it should be easier to debug.
procedure(convertm2tom1()
prog((cw cv tech selObjects i layerMun)
cw=hiGetCurrentWindow()
cv=geGetEditCellView()
selObjects=geGetSelSet(cv)
tech=ciCacheLibName(cv)
if(tech == "s18_tech" then
layerNum = 70
else
layerNum = 44
);if
for(i 0 length(selObjects)-1
selObjects~>layerNum=layerNum
);for
return(t)
);prog
);procedure
hiSetBindKey("Layout" "<key>1" "convertm2tom1()")
The thought is simple, you define the value of layerNum by detecting the technology.
And then apply to all the selected objects. |
|