DELETE BLOCK NAMED "APPROVED FOR CONSTRUCTION" FROM ALL DRAWINGS

DELETE BLOCK NAMED "APPROVED FOR CONSTRUCTION" FROM ALL DRAWINGS

ferrisb
Collaborator Collaborator
810 Views
3 Replies
Message 1 of 4

DELETE BLOCK NAMED "APPROVED FOR CONSTRUCTION" FROM ALL DRAWINGS

ferrisb
Collaborator
Collaborator

Happy Friday All.

Does anyone know of a way to do this?

 

DELETE BLOCK NAMED "APPROVED FOR CONSTRUCTION" FROM ALL DRAWINGS

0 Likes
811 Views
3 Replies
Replies (3)
Message 2 of 4

_gile
Consultant
Consultant

Hi

 

The following code erases all references of "APPROVED FOR CONSTRUCTION" block and purges it  from the drawing it is run in.

If you want to batch process multiple drawings, you'd use it in a batch script application as ScriptPro 2.

 

((lambda (/ b s i)
   (if (setq b (tblobjname "BLOCK" "APPROVED FOR CONSTRUCTION"))
     (progn
       (if (setq s (ssget "_X" '((0 . "INSERT") (2 . "APPROVED FOR CONSTRUCTION"))))
	 (repeat (setq i (sslength s))
	   (entdel (ssname s (setq i (1- i))))
	 )
       )
       (command "_.purge" "_blocks" "APPROVED FOR CONSTRUCTION" "_no")
     )
   )
 )
)


Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 3 of 4

ferrisb
Collaborator
Collaborator

Thanks,

Do you know where I can get a download for script pro, or something like it?

0 Likes
Message 4 of 4

_gile
Consultant
Consultant

Try this one:

https://github.com/ADN-DevTech/ScriptPro-installer



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes