|
提供一个完整示例,可以在此基础上面扩展。
代码如下:- axlCmdRegister( "ViewLayer" 'ViewLayer ?cmdType "general")
- defun( ViewLayer ()
- let((f h)
- f = axlTempFile()
- h = outfile(f "w")
- fprintf(h "FILE_TYPE=FORM_DEFN VERSION=2\n")
- fprintf(h "FORM\n")
- fprintf(h "FIXED\n")
- fprintf(h "PORT 41 15\n")
- fprintf(h "HEADER \"EDA365 Skill\"\n")
- fprintf(h "TILE\n")
-
- fprintf(h "FIELD outline_color\n")
- fprintf(h "FLOC 2 1\n")
- fprintf(h "COLOR 2 1\n")
- fprintf(h "ENDFIELD\n")
-
- fprintf(h "FIELD outline_check\n")
- fprintf(h "FLOC 4 1\n")
- fprintf(h "CHECKLIST \"Board Geometry/Outline\"\n")
- fprintf(h "ENDFIELD\n")
-
- fprintf(h "ENDTILE\n")
- fprintf(h "ENDFORM\n")
- close(h)
-
- w = axlFormCreate(gensym() f nil 'ViewLayer_Callback t)
- axlFormSetField(w,"outline_color",axlLayerGet("BOARD GEOMETRY/OUTLINE")->color)
- axlFormSetField(w,"outline_check",axlLayerGet("BOARD GEOMETRY/OUTLINE")->visible)
- axlFormDisplay(w)
- ))
- defun( ViewLayer_Callback (h)
- case( h -> curField
- ("outline_check"
- axlVisibleLayer("Board Geometry/Outline" ,h->curValue)
- axlVisibleUpdate(t)
- )
- )
- )
复制代码 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|