|
发表于 2016-4-28 17:07:30
|
显示全部楼层
- 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()
- axlSingleSelectPoint()
- FirstPin = car(axlGetSelSet())
- axlClearSelSet()
- axlHighlightObject(FirstPin)
- when(notdone && FirstPin
- axlSetFindFilter(?enabled list("noall" "VIAS" "pins") ?onButtons list("noall" "VIAS" "pins"))
- axlUIWPrint(nil "Please Select Second.....")
- ;axlSelect()
- axlSingleSelectPoint()
- 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 -")
- )
复制代码
原因:
done之后程序一直停在axlSelect等待选择,需要选择两次。所以。。。。。 |
|