Jump to content

Move layout-Rename layouts- Goto layout


BIGAL

Recommended Posts

Working on a big project and found moving around the layouts frustrating so created some layout lisp to make life easy.

 

Goto jumps to any layout like word etc by page number

 

Move layouts- moves current layout to a new position by its number position, Model is 0 and starts at layout1

 

; go to any layout by its page number
; By Alan H Feb 2014

(defun C:goto ( / alllayouts lay x num)
(setq num (getint "\nEnter tab number"))
(setq alllayouts (vla-get-Layouts (vla-get-activedocument (vlax-get-acad-object))))
(SETQ LAYNUM 0)
(vlax-for x alllayouts
(Setq laynum (+ 1 laynum))
) ;total number of layouts
(if (> num laynum)
(setq num (- laynum 1))
)
(vlax-for lay alllayouts
(if (= num (vla-get-taborder lay))
 (setvar "ctab" (vla-get-name lay))
) ; if
) ; for
) ; defun
(C:goto)

; renames multiple layout tabs when auto created
; By Alan H Feb 2014
(DEFUN ah:rentabs ( / ans plotabs tabname)
(setq doc (vla-get-activedocument (vlax-get-acad-object)))
(vlax-for plotabs (vla-get-Layouts doc)
 (setq tabname (vla-get-name plotabs) )
 (princ (strcat "\n " tabname))
 (setq ans (getstring "\nEnter new name"))
 (if (/= ans "")
   (vla-put-name plotabs ans)
 )
)
)
(AH:rentabs)

; move the current layout to a new location by tab No
; By Alan H 2014
(defun C:Mtab ( / lay num)
(setq num (getint "\nEnter tab number"))
(setq curtab (getvar "ctab")) 
(vlax-for lay (vla-get-Layouts (vla-get-activedocument (vlax-get-acad-object)))
(if (= curtab (vla-get-name lay))
(vla-put-taborder lay num)
) ; if
) ; for
) ; defun
(c:mtab)

 

; Got to a layout by its page name
; By Alan H Feb 2014
(defun C:layname ( / lay laynam)
(setq layname (getstring "\enEnter tab name "))
(vlax-for lay (vla-get-Layouts (vla-get-activedocument (vlax-get-acad-object)))
(if (= layname (vla-get-name lay))
 (setvar "ctab" (vla-get-name lay))
) ; if
) ; for
) ; defun
(C:layname)

Edited by BIGAL
Link to comment
Share on other sites

  • 4 weeks later...

Just thought I would add another plot a range of tabs bit like publish but without having to select

 

;Plots layouts by range
; By Alan H Feb 2014
(defun AH:pltlays ( / lay numlay numend)
(setq numlay (getint "\nEnter Start tab number"))
(setq numend (getint "\nEnter last tab number"))
(setq len (+ (- numend numlay) 1))
(repeat len
(vlax-for lay (vla-get-Layouts (vla-get-activedocument (vlax-get-acad-object)))
(if (= numlay (vla-get-taborder lay))
 (setvar "ctab" (vla-get-name lay))
) ; if
) ; for
(setq lay nil)
(princ name)
(COMMAND "-PLOT" "Y" "" "\\\\PRODPRN03\\lase a3" "A3 (297 x 420 mm)" "m" "LANDSCAPE" "N"
"W" "-6,-6" "807,560" "1=2" "C" "Y" "DesignLaserCOLOUR.ctb" "Y" "N" "N" "N" "N" "N" "y")
(setq numlay (+ numlay 1))
) ; end repeat
); defun
(AH:pltlays)

Link to comment
Share on other sites

  • 1 month later...

Maybe some one can help the goto layout works really well project with 62 sheets etc only little hiccup it would be nice if when you go to a layout it centered the current layout name in the screen seems to go either full left or right. Any ideas anyone ?

 

I posted this a while ago the only way I can get what I want is by using the arrow on the layout row scrolling a few tabs to the left etc I did observe if you go a lower tab it sets the current layout to the left if higher sets to the right. Any one have an idea how to get at these arrows.

 

Layout arrow.jpg

Edited by BIGAL
Link to comment
Share on other sites

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