ronjonp Posted July 28, 2010 Posted July 28, 2010 (edited) Nice solution Ron, - mine probably seems a tad OTT now lol Nonetheless ... good coding and yours will take care of locked layers. This would be my OTT method .... I would guess that if the selection set is huge the vla-erase would be much faster (just guessing though). (defun c:delq (/ doc qlayers) (vl-load-com) (setq doc (vla-get-activedocument (vlax-get-acad-object))) (vlax-for lay (vla-get-layers doc) (and (not (wcmatch (vla-get-name lay) "*|*")) (wcmatch (strcase (vla-get-name lay)) "Q*") (setq qlayers (cons lay qlayers)) ) ) (if (and qlayers (ssget "_x" '((8 . "Q*")))) (progn (progn (foreach l qlayers (vl-catch-all-apply 'vla-put-lock (list l :vlax-false))) (vl-catch-all-apply 'vla-erase (list (vla-get-activeselectionset doc))) (foreach l qlayers (vl-catch-all-apply 'vla-delete (list l))) ) ) (princ (strcat "\nBuh-bye.")) ) (princ) ) Edited July 28, 2010 by ronjonp Quote
johmmeke Posted February 12, 2012 Posted February 12, 2012 maybe a litle to late on this topic... is there a way to turn de lisp around.. en just delete a few named layouts? i need to delete 2 or 3 named layoputs from a lot of drawings. Greetz john Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.