EDA365电子论坛网

标题: cline转shape [打印本页]

作者: xianyu    时间: 2020-3-21 19:22
标题: cline转shape
axlCmdRegister("c2s" 'LCB_cline_to_shape ?cmdType "interactive"
?doneCmd 'LCB_Done ?cancelCmd 'LCB_Cancel)

procedure(LCB_cline_to_shape()
let( ()
axlSetFindFilter(?enabled list("noall" "clines" "lines" )
                  ?onButtons list("noall" "clines" "lines"))
LCBpopup = axlUIPopupDefine( nil (list
    (list "Undo" 'LCB_unDo)
    (list "Done" 'LCB_Done)
    (list "Cancel" 'LCB_Cancel)
     ))
axlUIPopupSet(LCBpopup)

LCB_mark = axlDBTransactionStart()
notdone = t
while(notdone
  lclines = axlGetSelSet(axlSelect(?prompt "Select Clines to convert to a shape."))
  println(lclines)
  if(lclines then
    foreach(clinedbid lclines
      ;layer = "etch/bottom"
      layer = car(axlGetSelSet())->layer
          println(layer)
       polydbid = axlPolyFromDB(clinedbid ?endCapType "ROUND")
           println(polydbid)
       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


作者: zanezhao    时间: 2020-3-27 16:34
感谢分享,很好用!:victory::victory:
作者: Lyhacc    时间: 2020-4-16 10:37
赞一个,非常好用
作者: max192    时间: 2020-8-25 10:31
这个怎么用




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