删除一个bl的所有插入
问候语如何编写短lisp来删除一个唯一块的所有插入?
或者如何从命令行执行相同的操作?
即
(命令“_erase”“”)
但这不起作用。。。。在某个地方一定有一个点对的地方?
TIA
史蒂夫 [列表=1]
[*]“选择”块
[*]“右键单击”,选择“选择类似项”
[*]按“删除”
[/列表]
谢谢,但如果我知道在命令“da da”等之后该做什么,我可以把它粘到lisp中。我打算让lisp程序自动删除我输入的硬接线块名。
感谢tho的回复
史蒂夫 另外,ERASE命令需要一个选择集。
(defun c:FOO(/ ss)
(if (setq ss (ssget ":S:E:L" '((0 . "INSERT"))))
(command
"._erase"
(ssget "_x"
(list '(0 . "INSERT")
(cons 2 (cdr (assoc 2 (entget (ssname ss 0)))))
(cons 410 (getvar 'ctab))))
"")
(prompt "\n** Nothing selected ** "))
(princ))
啊哈-如果我知道。。。
(defun c:FOO(/ ss)
(if (setq ss (ssget "_x"
(list '(0 . "INSERT")
'(2 . <BlockName>)
(cons 410 (getvar 'ctab)))))
(command "._erase" ss "")
(prompt "\n** No blocks found ** "))
(princ))
快速书写:
(defun c:DelBlock ( / blk ent inc obj sel )
(while
(not
(or
(eq "" (setq blk (getstring t "\nSpecify Block Name: ")))
(tblsearch "BLOCK" blk)
)
)
(princ "\nBlock not Found.")
)
(if
(and
(not (eq "" blk))
(setq sel (ssget "_X" (list '(0 . "INSERT") (cons 2 (strcat "`*U*," blk)))))
)
(repeat (setq inc (sslength sel))
(setq ent (ssname sel (setq inc (1- inc)))
obj (vlax-ename->vla-object ent)
)
(if
(or
(and
(vlax-property-available-p obj 'effectivename)
(eq
(strcase blk)
(strcase (vla-get-effectivename obj)))
)
(eq
(strcase blk)
(strcase (vla-get-name obj))
)
)
(entdel ent)
)
)
)
(princ)
)
(vl-load-com) (princ) 谢谢李和RM。。。我现在有工具来完成我的任务!!!这里的人都是网中最棒的!!!
干杯和啤酒!!
史蒂夫
我干杯喝啤酒。英雄联盟 不客气Steve
页:
[1]