|
楼主 |
发表于 2015-1-6 12:03:18
|
显示全部楼层
;subColor Test
;BY Vivien Luo
;2014/12/02 23:40
axlCmdRegister("aaa" 'subColor)
defun( subColor ()
subColorformcreate()
form = axlFormCreate(gensym() "./subColor.form" nil 'subColorAction nil)
axlFormSetField(form "RteKoAll" if(axlIsVisibleLayer("ROUTE KEEPOUT/ALL"), axlLayerGet("ROUTE KEEPOUT/ALL") ->color, 'black))
axlFormSetField(form "RteKoAll" axlIsVisibleLayer("ROUTE KEEPOUT/ALL"))
foreach(layer axlGetParam("paramLayerGroup:ETCH")->groupMembers
fieldColor = strcat("RteKo" layer)
colorLayer = strcat("ROUTE KEEPOUT/" layer)
axlFormSetField(form fieldColor if(axlIsVisibleLayer(colorLayer), axlLayerGet(colorLayer) ->color, 'black))
axlFormSetField(form fieldColor axlIsVisibleLayer(colorLayer))
)
axlFormDisplay(form)
)
defun(subColorAction (form)
case(form->curField
("RteKoAll"
layer = "ROUTE KEEPOUT/ALL"
axlVisibleLayer(layer, !axlIsVisibleLayer(layer))
axlVisibleUpdate(t)
axlFormSetField(form "RteKoAll" axlIsVisibleLayer("ROUTE KEEPOUT/ALL"))
axlFormSetField(form "RteKoAll" if(axlIsVisibleLayer("ROUTE KEEPOUT/ALL"), axlLayerGet("ROUTE KEEPOUT/ALL") ->color, 'black))
)
("Planecheck"
)
(t
;axlUIConfirm("ttt")
curField = form->curField
foreach(layer axlGetParam("paramLayerGroup:ETCH")->groupMembers
fieldColor = strcat("RteKo" layer)
when(curField == fieldColor
colorLayer = strcat("ROUTE KEEPOUT/" layer)
axlVisibleLayer(colorLayer, !axlIsVisibleLayer(colorLayer))
axlVisibleUpdate(t)
axlFormSetField(form fieldColor if(axlIsVisibleLayer(colorLayer), axlLayerGet(colorLayer) ->color, 'black))
axlFormSetField(form fieldColor axlIsVisibleLayer(colorLayer))
)
);end when
)
);end case
);end defun
defun( subColorformcreate ()
let((subColorPort)
subColorPort = outfile("./subColor.form")
fprintf(subColorPort "FILE_TYPE=FORM_DEFN VERSION=2\n")
fprintf(subColorPort "FORM\n")
fprintf(subColorPort "FIXED\n")
fprintf(subColorPort "PORT 30 5\n")
fprintf(subColorPort "HEADER \"SubColor Test\"\n")
fprintf(subColorPort "TILE\n")
fprintf(subColorPort "TEXT RteKo\n")
fprintf(subColorPort "TLOC 1 0\n")
fprintf(subColorPort "ENDTEXT\n")
fprintf(subColorPort "FIELD Planecheck\n")
fprintf(subColorPort "FLOC 10 0\n")
fprintf(subColorPort "CHECKLIST\n")
fprintf(subColorPort "ENDFIELD\n")
Layers=(axlGetParam("paramLayerGroup:ETCH")->groupMembers)
Tloc = 0
foreach(layer Layers
typelayer = strcat("ETCH/" layer)
layertype=axlDBGetLayerType(typelayer)
if(layertype=="CONDUCTOR"
then
Tloc = Tloc + 2
fprintf(subColorPort "TEXT %s\n" layer)
fprintf(subColorPort "TLOC 1 %d\n" Tloc)
fprintf(subColorPort "ENDTEXT\n")
fprintf(subColorPort "FIELD RteKo%s\n" layer)
fprintf(subColorPort "FLOC 10 %d\n" Tloc)
fprintf(subColorPort "COLOR 2 1\n")
fprintf(subColorPort "ENDFIELD\n")
);end else
);end foreach
fprintf(subColorPort "TEXT ALL\n")
fprintf(subColorPort "TLOC 1 %d\n" Tloc + 2)
fprintf(subColorPort "ENDTEXT\n")
fprintf(subColorPort "FIELD RteKoAll\n")
fprintf(subColorPort "FLOC 10 %d\n" Tloc + 2)
fprintf(subColorPort "COLOR 2 1\n")
fprintf(subColorPort "ENDFIELD\n")
fprintf(subColorPort "ENDTILE\n")
fprintf(subColorPort "ENDFORM\n")
close(subColorPort)
;debug form file
;axlFormTest("./subColor.form")
);end let
);end defun
特发出改了的skill, 请帮忙看下 "planecheck"怎么填写 |
|