EDA365电子工程师网

标题: cline转出shape均在bottom层,求大神修正让生成shape在当前cline所在层 [打印本页]

作者: pallayout    时间: 2014-9-30 11:12
标题: cline转出shape均在bottom层,求大神修正让生成shape在当前cline所在层
以下是一段cline转shape的代码,不足的是不管被转的cline在哪一层面,转出shape均在bottom层,那位大神帮忙更新一下,
我的想法是,在选择 被转的cline时,同时也读取当前层面,存入变量layer。初学都啥都不会!

/*
################################################################################
#                                                                              #
#                      Command: cline2shape                                    #
#                   Skill File: cline2shape.il                                 #
#                  How To Load: Command> (load("cline2shape.il"))              #
#               How To Execute: Command> cline2shape                           #
#                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" 'LCB_cline_to_shape ?cmdType "interactive"
?doneCmd 'LCB_Done ?cancelCmd 'LCB_Cancel)
procedure(LCB_cline_to_shape()
let( ()
axlSetFindFilter(?enabled list("noall" "clines")
                  ?onButtons list("noall" "clines"))
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."))
  if(lclines then
    foreach(clinedbid lclines
      layer = "etch/bottom"
       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


作者: XYX365    时间: 2014-10-1 13:34
你只要將這一行 layer = "etch/bottom"
改為這樣就可以 layer = clinedbid->layer


作者: pallayout    时间: 2014-10-1 14:28
如此如此的简单,skill要如何入门呀,谁传5年功力给我,哈




欢迎光临 EDA365电子工程师网 (https://bbs.elecnest.cn/) Powered by Discuz! X3.2