Jump to content

Recommended Posts

Posted

Scripts are not my strongest skill, so I hope to find some basic help.

I want to make a action macro that selects the copy the last layout tab, copy that, goes modelspace and -pan @some numbers, go back in modelspace. stop.

 

I've recorded the following steps succesfully:

Layout

copy

 

and

 

mspace

-pan

(basepoint plus some mumbers)

(@-3000,0)

 

I would like to know the command for selecting the last layout tab. Without using right-click functions which, as I know of, are not recorded?

 

Hope someone can help :)

Posted

This is the code for getting a list of layout tabs not sure if last is first

 


(setq doc (vla-get-activedocument (vlax-get-acad-object)))
(vlax-for lay (vla-get-Layouts doc)
 (setq plotabs (cons (vla-get-name lay) plotabs))
)

(setq lasttab (nth 1 plotabs )) ;or (cadr plotabs)

  • 3 weeks later...
Posted

Tank you, Bigal !

I got a bit lost with the code, but I found another lo-fi time consuming practical way :-)

Posted

Alternatively:

(car (reverse (layoutlist)))

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