Millsy29 Posted July 13, 2010 Posted July 13, 2010 It is part of the archive procedure where we leave the empty shell of the drawing in the archive folder next to an etransmit so you know if you are about to over wright an archived drawing and the deleting of tabs is just part of the cleaning process. so basically if a drawing has 5 tabs we archive 5 time 1 for each layout tab. i would like to automatically delete all tabs beside one chosen tab, whether it is the current tab or the name typed in via a lisp routine. Also i am a novice with stuff i can load the lisps in via appload but i don't know how to find the command to activate the loaded lisp can anyone help? (defun c:deletetabs () (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))) ) Thanks Millsy Quote
rkmcswain Posted July 13, 2010 Posted July 13, 2010 1. Do you mean that the new layout1 that it creates automatically includes a viewport? This is a setting on the Display tab in Options, under Layout elements ("Create viewport in new layouts") 2. The command name is the part right after the "C:" - in this case "DeleteTabs". Not all lisp functions include the "C:" though. Some may have no prefix, or a different prefix, but only functions with a "C:" prefix can be typed in like a normal command. Quote
Millsy29 Posted July 13, 2010 Author Posted July 13, 2010 Thanks got that C: means the command prompt... It is part of the archive procedure where we leave the empty shell of the drawing in the archive folder next to an etransmit so you know if you are about to over wright an archived drawing and the deleting of tabs is just part of the cleaning process. so basically if a drawing has 5 tabs we archive 5 time 1 for each layout tab. i would like to automatically delete all tabs beside one chosen tab, whether it is the current tab or the name typed in via a lisp routine. Thanks Quote
Lee Mac Posted July 13, 2010 Posted July 13, 2010 Hi Millsy, This should delete all tabs, (Layout1 being recreated). But it is almost identical to what you have. (defun c:DeleteAllTabs nil (vl-load-com) ;; © Lee Mac 2010 (vlax-for l (vla-get-Layouts (vla-get-ActiveDocument (vlax-get-acad-object) ) ) (if (not (eq "MODEL" (strcase (vla-get-Name l)))) (vla-delete l) ) ) (princ) ) Perhaps see here: http://www.cadtutor.net/forum/showthread.php?t=42431 Quote
Millsy29 Posted July 13, 2010 Author Posted July 13, 2010 hi lee sorry there was a little miss understanding of what was asked of me to do with this lisp we archive a drawing for every tab. so i would like to delete all other tab besides the one i'm archiving and try and do it in a lisp routine. millsy 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.