Shifting viewports

Shifting viewports

Anonymous
Not applicable
2,226 Views
6 Replies
Message 1 of 7

Shifting viewports

Anonymous
Not applicable

Hi all,

 

I was wondering if you could somehow shift a viewport center x location by a specific amount throughout multiple layouts? The problem i am having is that I have numerous layouts of a model and making a change to the beginning of the model (adding 2") will result in all layout viewports to be shifted by that amount. I then have to go into each layout and resize the viewport to display what it did before.

 

Any help is appreciated.

 

Edit: I basically want to run the "-p" command to all other viewports on different layouts.

0 Likes
Accepted solutions (1)
2,227 Views
6 Replies
Replies (6)
Message 2 of 7

ВeekeeCZ
Consultant
Consultant
Accepted solution

Try this... it will PAN from point 0,0,0 to a point by your specification.... 2,0 ??

 

Spoiler
(defun c:PanAllVPs (/ pt oCTAB en vp i ss vp)
  
  (if (setq pt (getpoint "\nSpecify displacement point: "))
    (progn      
      (setq oCTAB (getvar 'CTAB))
      (foreach x (layoutlist)
	(setvar 'CTAB x)
	(command "_.zoom" "_E")
	(if (setq ss (ssget "_X" (list '(0 . "VIEWPORT") (cons 410 x))))
	  (repeat (setq i (sslength ss))
	    (setq en (entget (ssname ss (setq i (1- i))))
		  vp (cdr (assoc 69 en)))
	    (if (> vp 1)
	      (progn
		(command "_.mspace")
		(setvar 'CVPORT vp)
		(command "_.PAN" '(0 0 0) pt)))))
	(command "_.pspace"))
      (setvar 'CTAB oCTAB)))
  (princ)
)

It process all the layouts and all VP. If you want to protect same of them, lock them.

Thanks to @hmsilva for the core loop.

Message 3 of 7

Anonymous
Not applicable

This is absolutely amazing! Its going to make everything so much easier and faster.

 

I appreciate your quick response and the time you spent in helping me out. Thanks again.

0 Likes
Message 4 of 7

mc5fan
Advocate
Advocate

How do you use that? I don't understand.

 

L.M.

Lee M.
0 Likes
Message 5 of 7

cadffm
Consultant
Consultant
Please stop with spam.
Set your setup in PAGESETUP or PLOTdialog and apply to pagesetup.

If you dont write what you are looking for we can not help!

The offset is reachable in both dialog.
PLOTOFFSET is for relativ to printarea or paperborder, look into F1

If you only searching for the white paper position in layout, set your want pagesetup and it will follow your given printing area.

Sebastian

0 Likes
Message 6 of 7

mc5fan
Advocate
Advocate

Spam? Really? How about less fluff from your end? My Manager explained it quick and simple with no attempt to throw insults. Maybe next time.

Lee M.
0 Likes
Message 7 of 7

3dwannab
Advocate
Advocate

Another similar thread here. I posted one that can work with locked viewports based on a modification of marko_ribars program.

 

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/pan-all-viewports-in-selected-layout... 

0 Likes