Jump to content

deletes all tabs excluding model and replaces Layout1


Recommended Posts

Posted

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

Posted

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.

Posted

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

Posted

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

Posted

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

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...