EDA365电子论坛网

标题: 簡單的SKILL源碼分享 設原點/grid [打印本页]

作者: jet2001    时间: 2021-1-28 16:14
标题: 簡單的SKILL源碼分享 設原點/grid

簡單的SKILL源碼分享:設原點 利用已存在 線段
將下列內容 存成 set_origin_new.il 並在 Allegro.ilinit 內加入 load("set_origin_new.il )
在 brd 或 dra 內輸入 o ; 然後 選 x 的線段 ; 再選 y 的線段 ; 即可 重設原點

(axlCmdRegister "o" 'set_origin_new)
procedure(set_origin_new()
let((x y)
if(!axlOKToProceed(t) then axlShell("Done"))
axlSetFindFilter(?enabled list("noall" "linesegs") ?onButtons list("all"))
printf(" Please select X ")
x=car(cadr(nth(0 axlGetSelSet(axlSingleSelectPoint()) )->startEnd))/-1.00
printf(" Please select Y ")
y=cadr(car(nth(0 axlGetSelSet(axlSingleSelectPoint()) )->startEnd))/-1.00
axlDBChangeDesignOrigin(x:y) axlClearSelSet()
)) ; robwu 2021/1/28




作者: jet2001    时间: 2021-1-28 16:18
簡單的SKILL源碼分享 設grid
將下列內容 存成 setxy_grid.il 並在 allegro.ilinit 內加入 load("setxy_grid.il )
輸入 gg 3 那grid x和y 都是3
輸入 gg 1.27 .635  那grid x是1.27 ; grid y 是.635 (方便建零件)

axlCmdRegister( "gg" `setxy_grid ?cmdType "general")  
procedure(setxy_grid(gx @optional gy)
let((x y op22)
x=evalstring(gx)/1.00
if(gy!=nil then y=evalstring(gy)/1.00 else  y=x)
op22=outfile("grid.scr")
fprintf(op22 "setwindow pcb\n")
fprintf(op22 "define grid\n")  
fprintf(op22 "setwindow form.grid\n")
fprintf(op22 "FORM grid non_etch non_etch_x_grids %1.4f\n" x)  
fprintf(op22 "FORM grid non_etch non_etch_y_grids %1.4f\n" y)  
fprintf(op22 "FORM grid all_etch all_etch_x_grids %1.4f\n" x)  
fprintf(op22 "FORM grid all_etch all_etch_y_grids %1.4f\n" y)  
fprintf(op22 "FORM grid done\n")   close(op22)
axlShell(sprintf(nil "scriptmode +invisible +noinfo;replay grid.scr;"))
sh("del grid.scr")
)) ; robwu 2021/1/28

作者: evaku    时间: 2022-10-29 20:12
謝謝樓主的分享 剛好有需要




欢迎光临 EDA365电子论坛网 (https://bbs.eda365.com/) Powered by Discuz! X3.2