xieeyawen 发表于 2025-3-24 17:00:54

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

本帖最后由 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()

xieeyawen 发表于 2025-3-25 16:23:59

本帖最后由 xieeyawen 于 2025-3-25 18:49 编辑

axlClearSelSet()      
axlSetFindFilter(?enabled list("noall" "shapes" ) ?onButtons list("noall" "shapes"))
while(axlSelect(?prompt "Please Select shapes to delete shapes on Etch Layer!")
_shape_list = axlGetSelSet()
foreach(_shape_dbid _shape_list layer =car(list(_shape_dbid))->layer layerclass=car(parseString(layer "/"))
when(layerclass=="ETCH"
axlDeleteObject(_shape_dbid)                                                                                                                              
);endwhen
);endforeach      
);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".

xieeyawen 发表于 2025-3-25 18:48:58

本帖最后由 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**********/
页: [1]
查看完整版本: 删除在Etch层的shape的skill,写的代码帮忙看下怎么改