|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
本帖最后由 defir 于 2016-4-28 14:00 编辑
看了几个代码想到一个给PIN和VIA添加KEEPOUT的方式。
但是运行右键done操作不能结束命令,会继续执行完while后才能结束,也就是要done三次才能真正结束。
求帮忙改进代码,谢谢!
代码如下:
- axlCmdRegister("Create_Keepout" 'Create_Keepout ?cmdType "interactive" ?doneCmd 'Create_Keepout_done ?cancelCmd 'Create_Keepout_Cancel)
- defun(Create_Keepout ()
-
- let((mypopup clinedbid polydbid dia)
- axlUIWPrint(nil "Create_Keepout V0.8")
- axlUIWPrint(nil "Written by df")
- notdone = t
-
- mypopup = axlUIPopupDefine(nil
- (list (list "Done" 'Create_Keepout_done)
- (list "Cancel" 'Create_Keepout_Cancel)))
- axlUIPopupSet(mypopup)
- dia=atoi(axlUIPrompt("Enter Diameter" "50")) ;用弹窗的方式获取自定义的直径
- while(notdone
- FirstPin = nil
- SecondPin = nil
- axlClearSelSet()
- axlSetFindFilter(?enabled list("noall" "VIAS" "pins") ?onButtons list("noall" "VIAS" "pins"))
- axlUIWPrint(nil "Please Select First.....")
- axlSelect()
- FirstPin = car(axlGetSelSet())
- axlClearSelSet()
- axlHighlightObject(FirstPin)
- axlSetFindFilter(?enabled list("noall" "VIAS" "pins") ?onButtons list("noall" "VIAS" "pins"))
- axlUIWPrint(nil "Please Select Second.....")
- axlSelect()
- SecondPin = car(axlGetSelSet())
- axlClearSelSet()
- axlHighlightObject(SecondPin)
- if(FirstPin != nil && SecondPin != nil then
- clinedbid=caar(axlDBCreateLine(list(FirstPin->xy SecondPin->xy),dia,"Etch/top"));Create Cline on the top.
- polydbid=axlPolyFromDB(clinedbid ?endCapType 'ROUND);Poly
- axlDeleteObject(clinedbid)
- df_shape=axlDBCreateShape(car(polydbid) t "Route Keepout/all" nil)
- axlDBAddProp(car(df_shape), list("ROUTES_ALLOWED"))
- axlDBAddProp(car(df_shape), list("VIAS_ALLOWED"))
- else
- axlUIWPrint(nil "Please Select via or pin....")
- );end if
- axlDehighlightObject(FirstPin)
- axlDehighlightObject(SecondPin)
- );end while
- ));end defun
-
- defun(Create_Keepout_done ()
- notdone = nil
- axlFinishEnteRFun()
- axlUIWPrint(nil "- Done -")
- )
- defun(Create_Keepout_Cancel ()
- notdone = nil
- axlCancelEnterFun()
- axlUIWPrint(nil "- Cancel -")
- )
复制代码
|
-
-
keepout.zip
941 Bytes, 阅读权限: 30, 下载次数: 8, 下载积分: 贡献 -30 , 威望 -10
skill源码
|