xieeyawen 发表于 2025-5-12 17:00:36

一个改变钻孔表模式的程序

本帖最后由 xieeyawen 于 2025-5-15 09:20 编辑

;NCmode钻孔模式form构建
procedure(NCmode()
   formfile = outfile("./nc.form")
        (fprintf formfile "FILE_TYPE=FORM_DEFN VERSION=2\n")
        (fprintf formfile "FORM\n")
        (fprintf formfile "FIXED\n")
        (fprintf formfile "PORT 32 46 \n")
        (fprintf formfile "HEADER \"One Click Output Tools\"\n") (fprintf formfile "\n")
        (fprintf formfile "TILE\n")
        (fprintf formfile "TEXT\"Click to execute\"blue_a\n")
        (fprintf formfile "TLOC 4 1\n")
        (fprintf formfile "ENDTEXT \n")

        (fprintf formfile "TEXT\"Only 1:\"red_a\n")
        (fprintf formfile "TLOC 1 4\n")
        (fprintf formfile "ENDTEXT \n")

        (fprintf formfile "FIELD nc_mode1\n")
        (fprintf formfile "FLOC 9 4\n")
        (fprintf formfile "CHECKLIST \"NC1\" \"1\"\n")
        (fprintf formfile "ENDFIELD\n")

        (fprintf formfile "FIELD nc_mode2\n")
        (fprintf formfile "FLOC 17 4\n")
        (fprintf formfile "CHECKLIST \"NC2\" \"1\"\n")
        (fprintf formfile "ENDFIELD\n")

        (fprintf formfile "\n")
        (fprintf formfile "ENDTILE\n") ;结束TILE
        (fprintf formfile "\n")
        (fprintf formfile "ENDFORM\n");结束FORM
       
        close(formfile)
        setform = axlFormCreate((gensym) "nc.form" '("C" "inner") 'func1 t)
        axlFormDisplay(setform)
        axlFormColorize(setform "blue_a" 'text 'blue)
        axlFormColorize(setform "red_a" 'text 'red)
        deleteFile("nc.form")
)
;form功能构建
procedure( (func1 dummy)
prog(nil
    case( (getq setform curField)
/*       
                  ("nc_mode1" NCmode_Init())
                  ("nc_mode2" NCmode_Init())
                  
*/
           ("nc_mode1"
       when(setform->curValue ;这样用when后就不会出现bug
         NCmode_Init()
            ))
   ("nc_mode2"
       when(setform->curValue ;这样用when后就不会出现bug
         NCmode_Init()
            ))

       
          )
                  )
                  )
;按钮或选项功能函数
defun( NCmode_Init ()
let((command1 command2)
if(axlFormGetField(setform "nc_mode1")
then
sprintf(command1 "setwindow pcb;generaledit;ncdrill legend;
                      setwindow form.nc_drilllegend;FORM nc_drilllegend layer_pair_legends YES;
                      FORM nc_drilllegend done; setwindow pcb")
axlShellPost(command1)
axlShell("Done")
else
sprintf(command2 "setwindow pcb;generaledit;ncdrill legend;
                      setwindow form.nc_drilllegend;FORM nc_drilllegend by_layer_legends YES;
                      FORM nc_drilllegend done; setwindow pcb")
axlShellPost(command2)
axlShell("Done")
)
)
)

xieeyawen 发表于 2025-5-15 09:20:28

2

xieeyawen 发表于 2025-5-28 11:47:25

1

xieeyawen 发表于 2025-6-19 17:06:42

1
页: [1]
查看完整版本: 一个改变钻孔表模式的程序