(and (setq ss (ssget "X" '((0 . "INSERT") (2 . "FORCONSTRUCTION"))))
(setq lst (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))))
(mapcar (function (lambda (x) (entdel x))) lst)
)
Thanks Kerry I forgot about entdel not working in all cases.
;; RemStamps.lsp
;; MODIFIED CODE
;; thanks to Codehimbelonga kdub@theSwamp 2014/10/08
(vl-load-com)
(defun remstamp (blknames / blkname)
(setq exprt (getvar "expert"))
(setvar "EXPERT" 5)
(command "-layer" "set" "0" "")
(command "Zoom" "All")
(repeat 3 (command "-PURGE" "ALL" "*" "N"))
;;
(foreach blkname blknames
(if
(setq ss (ssget "X" (list '(0 . "INSERT") (cons 2 blkname))))
(while (setq block (ssname ss 0))
(vla-delete (vlax-ename->vla-object block))
(ssdel block ss)
)
)
)
(vl-cmdf "_.Audit" "Y")
(repeat 3 (command "-PURGE" "ALL" "*" "N"))
(setvar "EXPERT" exprt)
(command "QSAVE")
(princ)
)
(princ)
;;;;; RemStamp.scr
;;;(LOAD "P:\\DWells\\LSP\\REMOVE_Block\\REMSTAMP.lsp")
;;;(RemStamp (list "FORCONSTRUCTION" "REMBLOCK"))
;|«Visual LISP© Format Options»
(70 2 45 2 nil "end of " 80 9 1 0 0 nil nil nil T)
;*** DO NOT add text below the comment! ***|;
(remstamp "REMBLOCK,FORCONSTRUCTION")
You have to supply the block names .. like so:Hummm, I don't think so.Quote(remstamp "REMBLOCK,FORCONSTRUCTION")
:(
I get that, but I can't use it at the command prompt that way if I load the lsp...
Awesome for running with SCRIPT PRO. but what could we do to get it to work at the command prompt.. ultimatly multiple options are very cool, but being aple to type the comand.. hit enter then type the block name would be ideal. like mentioned before, one could always script it to run twice
remstamp
forconstruction
remstamp
forapproval
qsave
It would be handy to have at the command prompt while in the file as much as just for scripting use.
Does that make sence?
most of the crew i work with don't even know how to make .scr files.. so I got to get it simpler.
You have to supply the block names .. like so:Quote(remstamp "REMBLOCK,FORCONSTRUCTION")
No worries Charles :)You have to supply the block names .. like so:Quote(remstamp "REMBLOCK,FORCONSTRUCTION")
Sorry Ron I thought you were talking about my code.
I'm slipping, need more sleep. :(