Cadence Skill 论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 86|回复: 2

[分享] 删除在Etch层的shape的skill,写的代码帮忙看下怎么改

[复制链接]
发表于 2025-3-24 17:00:54 | 显示全部楼层 |阅读模式
10SKILL币
本帖最后由 xieeyawen 于 2025-3-25 18:50 编辑

      axlMsgPut("Select shape to delete Etch!")
      axlClearSelSet()        
      axlSetFindFilter( ?enabled  '("noall" "shapes") ?onButtons '("shapes") )
      while(axlSelect(?prompt "Please Select shapes to del")
                  shapes = axlGetSelSet()
                  foreach(shapeb axlDBGetShapes("ETCH")
                            foreach(shapea shapes
                                when(shapea == shapeb
                                                  axlDeleteObject(shapea)
                                                      );ednwhen
                                                      );endforeach
                                      );endforeach      
                                      );endwhile
      axlClearSelSet()

 楼主| 发表于 7 天前 | 显示全部楼层
本帖最后由 xieeyawen 于 2025-3-25 18:49 编辑
  1. axlClearSelSet()        
  2. axlSetFindFilter(?enabled list("noall" "shapes" ) ?onButtons list("noall" "shapes"))
  3. while(axlSelect(?prompt "Please Select shapes to delete shapes on Etch Layer!")
  4. _shape_list = axlGetSelSet()
  5. foreach(_shape_dbid _shape_list layer =car(list(_shape_dbid))->layer layerclass=car(parseString(layer "/"))
  6. when(layerclass=="ETCH"
  7. axlDeleteObject(_shape_dbid)                                                                                                                                
  8. );endwhen
  9. );endforeach        
  10. );endwhile
复制代码
代码改成上面的还是不行啦。报错

Cannot edit Shape "Dummy Net, Etch/Top". Symbol "Mark*" has the LOCKED property.
Cannot edit Shape "Dummy Net, Etch/Top". Symbol "Mark*" has the LOCKED property.
Cannot edit Shape "Dummy Net, Etch/Top". Symbol "Mark*" has the LOCKED property.
Cannot edit Shape "Dummy Net, Etch/Top". Symbol "Mark*" has the LOCKED property.
Cannot edit Shape "Dummy Net, Etch/Top". Symbol "Mark*" has the LOCKED property.
Cannot edit Shape "Dummy Net, Etch/Top". Symbol "Mark*" has the LOCKED property.

W-  Cannot delete element type: Shape(auto-generated) "Gnd, Etch/Top".

回复

使用道具 举报

 楼主| 发表于 7 天前 | 显示全部楼层
本帖最后由 xieeyawen 于 2025-3-25 19:30 编辑


axlCmdRegister("deletchshape" 'deletchshape ?cmdType "interactive"
               ?doneCmd 'S_done ?cancelCmd 'S_cancel)

procedure(deletchshape()
prog( (notdone Spopup S_mark)
  Spopup = axlUIPopupDefine( nil (list
    (list "Undo" 'S_undo)
    (list "Done" 'S_done)
    (list "Cancel" 'S_cancel)
     ))
    axlUIPopupSet(Spopup)
                S_mark = axlDBTransactionStart()
                notdone = t
                axlClearSelSet()        
    axlSetFindFilter(?enabled list("noall" "shapes" ) ?onButtons list("noall" "shapes"))
while(notdone   
while(axlSelect(?prompt "Please Select shapes to delete shapes on Etch Layer!")
                axlMsgPut("Select shape to delete Etch!")
                axlClearSelSet()        
                axlSetFindFilter( ?enabled  '("noall" "shapes") ?onButtons '("shapes") )
                while(axlSelect(?prompt "Please Select shapes to del")
                shapes = axlGetSelSet()
                foreach(shapeb axlDBGetShapes("ETCH")
                        foreach(shapea shapes
                                when(shapea == shapeb
                                axlDeleteObject(car(list(shapea))->shapeBoundary)
                                        );ednwhen
                                        );endforeach
                                        );endforeach      
                                        );endwhile
                axlClearSelSet()

    /*************增加撤销和完成功能********************/       
                axlDBTransactionCommit(S_mark)       
                                );endwhile
                                );ednwhile
        );endlet
);endprocedure

procedure(S_undo()
let( ()
  if(! axlDBTransactionOops(S_mark) then
    axlUIWPrint(nil "-- Nothing Left To Undo. --")
  else
    axlUIWPrint(nil "-- Replacing Clines. --")
  ); endif
  axlClearSelSet()
)); end let procedure

procedure(S_cancel()
let( ()
  axlUIWPrint(nil "** Cancelled Program. **")
  ;axlDBTransactionRollback(S_mark)
  notdone = nil
  axlClearSelSet()
  axlCancelEnterFun()

)); end let procedure

procedure(S_done()
let( ()
  axlUIWPrint(nil "- Done -")
  axlDBTransactionCommit(S_mark)
  notdone = nil
  axlCancelEnterFun()

)); end let and procedure




/**********方法2**********
                _shape_list = axlGetSelSet()
foreach(_shape_dbid _shape_list
layer =car(list(_shape_dbid))->layer
;foreach返回的是l_valueList / l_result,_shape_dbid要加个list强制变为list
;再用car去壳才能得到shape的dbid信息再指向layer,所以是car(list(_shape_dbid))
layerclass=car(parseString(layer "/"))
when(layerclass=="ETCH"
axlDeleteObject(car(list(_shape_dbid))->shapeBoundary)                ;必须知道shape的shapeBoundary的dbid才能删除                                                                                                       
);endwhen
);endforeach       
);endwhile
                axlClearSelSet()
**********方法2**********/


/**********方法3**********
      axlMsgPut("Select shape to delete Etch!")
      axlClearSelSet()        
      axlSetFindFilter( ?enabled  '("noall" "shapes") ?onButtons '("shapes") )
      while(axlSelect(?prompt "Please Select shapes to del")
                  shapes = axlGetSelSet()
            foreach(i axlSubclassRoute()
                foreach(c shapes
                   when(
                     car(list(c))->layer=axlLayerGet(sprintf(nil "ETCH/%s" i))
                     axlDeleteObject(car(list(c))->shapeBoundary)
                     )
                     );endforeach
                     );endforeach      
                     );endwhile
                axlClearSelSet()
**********方法3**********/
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|网站地图|Cadence Skill 论坛 ( 蜀ICP备13024417号 )

GMT+8, 2025-4-1 01:01 , Processed in 0.139825 second(s), 13 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表