Bill Tillman Posted January 11, 2013 Posted January 11, 2013 I have been searching this morning and only find examples on how to delete all layout tabs (except Model). I have two layout tabs which depending on the user's staus either need to be left in or deleted. I'm trying to delete just these two layout tabs but would rather not have to loop through all of them and use boolean to delete only these two. Isn't there a more direct way to say just delete a layout tab called BOM8x11. Quote
pBe Posted January 11, 2013 Posted January 11, 2013 (edited) (if (member "BOM8x11" (layoutlist)) (vla-delete (vla-item (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object) ) ) "BOM8x11" ) ) ) or (if (not (vl-catch-all-error-p (setq vp (vl-catch-all-apply 'vla-item (list (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object))) "BOM8X11" ))))) (vla-delete vp)) or (command "_.layout" "Delete" "BOM8X11") Edited January 11, 2013 by pBe Quote
Bill Tillman Posted January 11, 2013 Author Posted January 11, 2013 Works like a champ. Many thanks. Quote
nod684 Posted January 16, 2013 Posted January 16, 2013 found this somewhere on the net.. cant remember where sorry but its working (defun c:deltab () (setq *doc (cond (*doc) ((vla-get-ActiveDocument (vlax-get-acad-object))))) (vlax-for lay (vla-get-layouts *doc) (if (not (eq "MODEL" (strcase (vla-get-Name lay)))) (vla-delete lay))) (print "All Tabs Deleted, Layout1 Tab is restored by default") (princ )) (princ "\nDELTAB Loaded. Type DELTAB to Start.") 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.