|
兄弟给你改改;
可输入4个参数,依次对应如下格点:
non_etch_x_grids
non_etch_y_grids
all_etch_x_grids
all_etch_y_grids
命令格式:g 3 3 5 5
若某一格点保持不变,则对应的参数为任意字符:
such as: g 6 m k 9
such as: g 7 8
such as: g 6 y 8
看看源文件就知道怎么用了.
axlCmdRegister( "g" 'x_grid)
defun( x_grid (@optional (n_ex "") (n_ey "") (a_ex "") (a_ey ""))
if( ((n_ex != "")||(n_ey != "")||(a_ex != "")||(a_ey != ""))
then runscr(n_ex n_ey a_ex a_ey)
else axlShell("define grid"))
)
defun( runscr (n_ex n_ey a_ex a_ey)
ScriptFileName=axlTempFile()
fp=axlDMOpenFile("ALLEGRO_SCRIPT", ScriptFileName, "w")
fprintf(fp "scriptmode +i\n\n")
fprintf(fp "setwindow pcb\n")
fprintf(fp "define grid \n")
fprintf(fp "setwindow form.grid\n")
if((n_ex != "") fprintf(fp "FORM grid non_etch non_etch_x_grids %L \n" n_ex))
if((n_ey != "") fprintf(fp "FORM grid non_etch non_etch_y_grids %L \n" n_ey))
if((a_ex != "") fprintf(fp "FORM grid all_etch all_etch_x_grids %L \n" a_ex))
if((a_ey != "") fprintf(fp "FORM grid all_etch all_etch_y_grids %L \n" a_ey))
fprintf(fp "FORM grid done \n")
axlDMClose(fp)
sprintf(runScript,"replay %s",ScriptFileName)
axlShell(runScript)
) |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|