Anyone know if there exist any lisp to Copy ViewPort's layer settings to Selected Layout's Viewports?
Something like this:
1 Activate the first Layout to change
2 double click to ViewPort
2 Thaw/ Freeze your layers (viewport)
3 Run AutoLisp routine
4 Copy the configuration to all selected Layouts
Solved! Go to Solution.
Solved by ВeekeeCZ. Go to Solution.
Solved by ВeekeeCZ. Go to Solution.
Solved by ВeekeeCZ. Go to Solution.
Awesome lisp, How can I apply to each ViewPorts inside the select Layouts?
Here's the adjusted code for multiple selection.
(defun c:VPV (/ tempstr int smallstr vpent laylist vpss idx) ;ViewPort (V)paste (if (setq laylist (vl-bb-ref 'vpc_laylist)) (progn (setq oldecho (getvar "cmdecho")) (setvar "cmdecho" 0) (command "_undo" "_be") (if (setq vpss (ssget '((0 . "VIEWPORT")))) (repeat (setq idx (sslength vpss)) (setq vpent (ssname vpss (setq idx (1- idx)))) (setq tempstr "") (foreach x laylist (setq tempstr (strcat tempstr x ","))) (setq tempstr (substr tempstr 1 (- (strlen tempstr) 1))) (command "vplayer" "t" "*" "s" vpent "" "") (while (> (strlen tempstr) 256) (setq smallstr (substr tempstr 1 256)) (setq int (vl-string-position (ascii ",") smallstr 0 t)) (setq smallstr (substr smallstr 1 int) tempstr (substr tempstr (+ int 1)) ) (command "vplayer" "f" smallstr "s" vpent "" "") ) (command "vplayer" "f" tempstr "s" vpent "" "") )) (command "_undo" "_end") (setvar "cmdecho" oldecho) );progn );if (princ) )
Thanks lot, this work for select multiple Viewport at same Layout.
excuse me, could add an option more for select multiple Layouts? I mean, some like:
1 Select multiple Layouts (PaperSpaces)
1 Run c:VPCopy
2 Select the Viewport to Copy
3 Run new command c:VPC2LAYOUTS, to copy the stored list to all ViewPorts in the selected Layouts (PaperSpaces)
@jtm2020hyo wrote:
Thanks lot, this work for select multiple Viewport at same Layout.
excuse me, could add an option more for select multiple Layouts? I mean, some like:
1 Select multiple Layouts (PaperSpaces)
1 Run c:VPCopy
2 Select the Viewport to Copy
3 Run new command c:VPC2LAYOUTS, to copy the stored list to all ViewPorts in the selected Layouts (PaperSpaces)
Use the last function in @ВeekeeCZ code to do this:
C:VPCOPY
C:VPPASTE
C:VPAPPLY
@ronjonp wrote:
@jtm2020hyo wrote:
Thanks lot, this work for select multiple Viewport at same Layout.
excuse me, could add an option more for select multiple Layouts? I mean, some like:
1 Select multiple Layouts (PaperSpaces)
1 Run c:VPCopy
2 Select the Viewport to Copy
3 Run new command c:VPC2LAYOUTS, to copy the stored list to all ViewPorts in the selected Layouts (PaperSpaces)
Use the last function in @ВeekeeCZ code to do this:
C:VPCOPY
C:VPPASTE
C:VPAPPLY
That's the one that I use most. But it does something else.
Any way thanks a lot, but maybe I used this routine wrong?
Could explain us a bit how use VPPASTE to multiple Layouts_Tabs? or if this is not possible?
(defun c:VPVAll (/ tempstr int smallstr vpent laylist e tabs oldtab oldecho vpss idx) ;ViewPort (V)paste (if (setq laylist (vl-bb-ref 'vpc_laylist)) (progn (vlax-for o (vla-get-layouts (vla-get-ActiveDocument (vlax-get-acad-object))) (setq e (vlax-vla-object->ename o)) (if (= 1 (getpropertyvalue e "TabSelected")) (setq tabs (cons (getpropertyvalue e "LayoutName") tabs)))) (setq oldecho (getvar 'cmdecho)) (setvar "cmdecho" 1) (setq oldtab (getvar 'ctab)) (command "_undo" "_be") (foreach tab tabs (setvar 'ctab tab) (command "_.pspace") (if (setq vpss (ssget "_X" (list '(0 . "VIEWPORT") (cons 410 (getvar 'ctab))))) (repeat (setq idx (sslength vpss)) (setq vpent (ssname vpss (setq idx (1- idx)))) (setq tempstr "") (foreach x laylist (setq tempstr (strcat tempstr x ","))) (setq tempstr (substr tempstr 1 (- (strlen tempstr) 1))) (command "vplayer" "t" "*" "s" vpent "" "") (while (> (strlen tempstr) 256) (setq smallstr (substr tempstr 1 256)) (setq int (vl-string-position (ascii ",") smallstr 0 t)) (setq smallstr (substr smallstr 1 int) tempstr (substr tempstr (+ int 1)) ) (command "vplayer" "f" smallstr "s" vpent "" "")) (command "vplayer" "f" tempstr "s" vpent "" "") ))) (setvar 'ctab oldtab) (command "_undo" "_end") (setvar 'cmdecho oldecho) );progn );if (princ) )