|
EDA365欢迎您!
您需要 登录 才可以下载或查看,没有帐号?注册
x
求助,下面程序单独调试是成功的,为什么放到FORM里就不成功了呢?
pinnum和setting这两个变量,调试时是直接设置的。_SPGInitVar()放到FORM时是放前面了,没有放到下面那段程序里。
case(formPort->curField
("L2R"
sequence="L2R"
)
("R2L"
sequence="R2L"
)
("U2D"
sequence="U2D"
)
("D2U"
sequence="D2U"
)
("re_name"
_SPGInitVar()
pinnum=axlFormGetField(formPort "PN")
setting=axlFormGetField(formPort "set")
if(sequence=="L2R"
then
selection()
)
)
这个是FORM里的设置
下面这段程序单独调试是成功的:
procedure(selection()
_SPGInitVar()
(axlClearSelSet)
(axlVisibleDesign nil)
(axlVisibleLayer "package geometry/pin_number" t)
(axlSetFindFilter ?enabled
list("noall" "text") ?onButtons
list("noall" "text")
)
getpnub = axlGetSelSet(axlSelect())
foreach(pin getpnub
padNub=(pin->text)
padpoint=(pin->xy)
numbs=cons(padNub numbs)
points=cons(padpoint points)
)
(axlClearSelSet)
axlFinishEnterFun()
printf("%L\n" numbs)
printf("%L\n" points)
pinnum="A4"
setting=2
L=length(numbs)
rexCompile("^[a-zA-Z]+")
unless(rexExecute(pinnum)
d=atoi(pinnum)
)
if(rexExecute(pinnum)
then
rexCompile("[0-9]+")
rexExecute(pinnum)
str1=rexSubstitute("\\0")
d=atoi(str1)
)
num=d
rexCompile("^[a-zA-Z]+")
for(i 1 L
if(rexExecute(pinnum)
then
str=rexSubstitute("\\0")
c=parseString(str1 "")
a=car(c)
if(a=="0"
then
sum=cons(concat(str 0 num) sum)
else
sum=cons(concat(str num) sum)
)
num=num+setting
else
sum=cons(num sum)
num=num+setting
)
)
mytext = make_axlTextOrientation(?textBlock "18", ?rotation 0., ?mirrored nil, ?justify "center")
axlDeleteObject(getpnub)
rexCompile("^[a-zA-Z]+")
for(i 0 L-1
numb1=nth(i sum)
points1=nth(i points)
if(rexExecute(pinnum)
then
axlDBCreateText(sprintf(nil "%s" numb1), points1, mytext, "package geometry/pin_number", nil)
else
axlDBCreateText(sprintf(nil "%n" numb1), points1, mytext, "package geometry/pin_number", nil)
)
)
axlShell("done")
)
procedure( _SPGInitVar()
prog( nil
numbs=nil
points=nil
pinnum=nil
setting=0
sum=nil
num=d
str=nil
str1=nil
numb1=nil
points1=nil
)
)
|
|