Jump to content

Recommended Posts

Posted (edited)
Nice solution Ron, - mine probably seems a tad OTT now lol :P

 

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 by ronjonp
  • 1 year later...
  • Replies 21
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    7

  • ShortChop

    7

  • ronjonp

    4

  • FazBear

    2

Posted

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

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...