Jump to content

Run a command for all the tabs in a drawing?


Recommended Posts

Posted

I want to simply run a command (or a series of commands) on every tab

in a drawing. The tabs most likely are not named in any consistent fashion.

 

It might be as simple as going to a tab and zooming extents.

 

I have no idea how to cycle through the tabs and end

when the command is run on the last tab.

 

Help please!!

 

Thanks!

Posted

You could use a construct such as:

 

(foreach tab (layoutlist)
 (setvar 'CTAB tab)

...

)

Bear in mind that (layoutlist) excludes the Model tab, to include it, you could use:

 

(foreach tab (cons "Model" (layoutlist))
 (setvar 'CTAB tab)

 ...

)

Lee

Posted

Thanks Lee...

 

I'm digging through older threads right now looking at what others have done.

 

In my frustration I always forget to search before posting...

 

'preciate it!

Posted

sample

 

 
(defun c:test ( / ot ac )
 (vl-load-com)
 (setq this_dwg (vlax-get-acad-object))
  (foreach d (layoutlist)
     (setvar 'CTAB d)
   (vla-ZoomExtents this_dwg))
 (princ)
)

 

 

Nevermind: :lol:

Lee you're a smoking gun :)

Posted

If you find my Finalblitz lisp, you could try that. It works on multiple tabs and multiple drawings.

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