Originally Posted by
ECASAOL350033
I have this lisp routine that somehow used to work though it deletes all my layouts now.
Code:
(defun c:removeline ()
(vlax-for n (vla-get-blocks
(vla-get-activedocument
(vlax-get-acad-object)
)
)
(vl-catch-all-apply 'vla-delete (list n))
)
(princ)
)
This routine used to remove all nested linetypes that were not used. It worked a couple of time though for some reason it deletes all the layout tabs. I think that either a variable has been changed or something else. It has the same effect on all the other pc's in the office (deletes layout tabs)
No... This code must have been changed, as it will never remove Linetypes, nor Layouts by deleting Block Definitions (it will delete the geometry from a given Layout's Block though).
To delete unused Linetypes, instead consider:
Code:
(vl-load-com)
(defun c:PurgeLin ()
(princ "\nProcessing, please wait... ")
(princ)
(vlax-for lin (vla-get-linetypes
(vla-get-activedocument
(vlax-get-acad-object)
)
)
(vl-catch-all-apply 'vla-delete (list lin))
)
(princ)
)