/* ################################################################################ # # # Command: cline2shape_outline # # Skill File: cline2shape_outline.il # # How To Load: Command> (load("cline2shape_outline.il")) # # How To Execute: Command> cline2shape_outline # # Creation Date: 07/15/2003 # # # ################################################################################ ################################################################################ # DISCLAIMER: # # The user of this command assumes all responsibility and does not # # hold Cadence Design Systems nor the author of this code for any # # unwarranted results or problems due to the use of this code. # # # # This is non-supported code and the user may modify it as needed. # # # ################################################################################ ################################################################################ # Know Bug: Sometimes the program will not convert all cline segments but it # # will DELETE all segments. Use at your OWN discretion! # # Select Cancel or Undo before exiting the command to restore # # # to original Clines. # # # ################################################################################ */ axlCmdRegister("cline2shape_outline" 'LCB_cline_to_shape_outline ?cmdType "interactive" ?doneCmd 'LCB_Done ?cancelCmd 'LCB_Cancel) procedure(LCB_cline_to_shape_outline() let( () axlSetFindFilter(?enabled list("noall" "clines") ?onButtons list("noall" "clines")) LCBpopup = axlUIPopupDefine( nil (list (list "Done" 'LCB_Done) (list "Undo" 'LCB_unDo) (list "Cancel" 'LCB_Cancel) )) axlUIPopupSet(LCBpopup) LCB_mark = axlDBTransactionStart() notdone = t while(notdone lclines = axlGetSelSet(axlSelect(?prompt "Select Clines to convert to a shape.")) if(lclines then foreach(clinedbid lclines layer = "board geometry/outline" polydbid = axlPolyFromDB(clinedbid ?endCapType "ROUND") if(polydbid then axlDeleteObject(clinedbid) if(! axlDBCreateShape(car(polydbid) t layer) then axlUIWPrint(nil "** Error. Failed to create Shape from Cline. **") ); endif if(cadr(polydbid) then axlDBCreateShape(cadr(polydbid) t layer) ) else axlUIWPrint(nil "** Error. Failed to create Polydbid from Cline. **") ); endif ); end foreach cline ); endif ); end while axlDBTransactionCommit(LCB_mark) )); let and procedure procedure(LCB_unDo() let( () if(! axlDBTransactionOops(LCB_mark) then axlUIWPrint(nil "-- Nothing Left To Undo. --") else axlUIWPrint(nil "-- Replacing Clines. --") ); endif axlClearSelSet() )); end let procedure procedure(LCB_Cancel() let( () axlUIWPrint(nil "** Cancelled Program. **") ;axlDBTransactionRollback(LCB_mark) notdone = nil axlClearSelSet() axlCancelEnterFun() )); end let procedure procedure(LCB_Done() let( () axlUIWPrint(nil "- Done -") axlDBTransactionCommit(LCB_mark) notdone = nil axlCancelEnterFun() )); end let and procedure