|
一种改法,将axlSelect改为axlSingleSelectPoint,另外在done cancel回调函数中将菜单清除axlUIPopupSet(nil), 另外axlSelect函数已经是多选操作,不需要调用两次。
- 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.....")
- axlSingleSelectPoint();change
- FirstPin = car(axlGetSelSet())
- axlClearSelSet()
- axlHighlightObject(FirstPin)
- axlSetFindFilter(?enabled list("noall" "VIAS" "pins") ?onButtons list("noall" "VIAS" "pins"))
- axlUIWPrint(nil "Please Select Second.....")
- axlSingleSelectPoint();change
- 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()
- axlUIPopupSet(nil);change
- axlUIWPrint(nil "- Done -")
- )
- defun(Create_Keepout_Cancel ()
- notdone = nil
- axlCancelEnterFun()
- axlUIPopupSet(nil);change
- axlUIWPrint(nil "- Cancel -")
- )
复制代码
|
|