- "Select" block
- "Right-Click", Select "Select Similar"
- Press "Delete"
Registered forum members do not see this ad.
Greetings
How to write short lisp to erase all insertions of one unique block?
or how to do same from command line?
i.e.
(command "._erase" <blockname> "")
but this doesn't work.... somewhere there must be a place for a dotted pair?
TIA
Steve
- "Select" block
- "Right-Click", Select "Select Similar"
- Press "Delete"
"Potential has a shelf life." - Margaret Atwood
Separately, the ERASE command is expecting a selection set.
Code:(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))
"Potential has a shelf life." - Margaret Atwood
Quickly written:
Code:(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)
Lee Mac Programming
With Mathematics there is the possibility of perfect rigour, so why settle for less?
Just another Swamper
Thank you Lee and RM... I now have the tools to complete my task !!! guys here are the best of the NET !!!
cheers and beers around !!
Steve
Registered forum members do not see this ad.
You're welcome Steve![]()
Lee Mac Programming
With Mathematics there is the possibility of perfect rigour, so why settle for less?
Just another Swamper
Bookmarks