Jump to content

Recommended Posts

Posted

just wondering....

 

i do a lot of projections when doing elevations / sections

and what i do is have the 2 viewports in model space in which the top vport shows the plan while the bottom shows the elevation / section am doing. Then using xlines, I project what is on the plan to my drawing below

.

now, is it possible to pan in one viewport and the other viewport follows too? can it be done thru lisp or some other tool?

Posted

Pst. I removed the dots in your title - if this thread goes over two pages, dots in the title can make it non-accessible. On second thought, I renamed the tread :thumbsup:

 

Good question though, I will move this to the lisp-forum and hope you get a good answer (that I can use too!)

Posted

Something like this?

;;; Pan in All Viewports (28-XI-2012)
(defun c:PAV( / oldCVPort oldCmdEcho listVPorts pointBase pointMove )
(setq listVPorts (mapcar 'car (vports))
      oldCmdEcho (getvar "CMDECHO")
      oldCVPort  (getvar "CVPORT"))

(setvar "CMDECHO" 0)
(if (and (setq pointBase (getpoint           "\nBase point: "))
         (setq pointMove (getpoint pointBase "\nNew point: ")))
 (foreach itemVPort listVPorts
  (setvar "CVPORT" itemVPort)
  (command "_PAN" pointBase pointMove)
 )
)

(setvar "CVPORT"  oldCVPort)
(setvar "CMDECHO" oldCmdEcho)
(princ)
)

Posted (edited)

Thanks a lot Mircea! working as i want it to be...

this will be useful. thanks again

Edited by nod684
Posted

Thanks Tiger! sorry for the dots. don't know about that.

its just am not sure if my question is possible :)

 

thanks again.

Posted

no worries Nod, it's just a bug, nothing that is widely known.

Posted

Glad to hear that you found that useful, nod684! You're entirely welcome!

  • 1 year later...
Posted (edited)

please anyone could help on this issue

 

 

New point: int of ; error: AutoCAD variable setting rejected: "CVPORT" 1

 

 

 

;;; Pan in All Viewports (28-XI-2012)
(defun c:PAV( / oldCVPort oldCmdEcho listVPorts pointBase pointMove )
(setq listVPorts (mapcar 'car (vports))
      oldCmdEcho (getvar "CMDECHO")
      oldCVPort  (getvar "CVPORT"))

(setvar "CMDECHO" 0)
(if (and (setq pointBase (getpoint           "\nBase point: "))
         (setq pointMove (getpoint pointBase "\nNew point: ")))
 (foreach itemVPort listVPorts
  (setvar "CVPORT" itemVPort)
  (command "_PAN" pointBase pointMove)
 )
)

(setvar "CVPORT"  oldCVPort)
(setvar "CMDECHO" oldCmdEcho)
(princ)
)

Edited by SLW210
Added Code Tags
Posted (edited)
please anyone could help on this issue

 

 

New point: int of ; error: AutoCAD variable setting rejected: "CVPORT" 1

 

;;; Pan in All Viewports (28-XI-2012)
(defun c:PAV( / oldCVPort oldCmdEcho listVPorts pointBase pointMove )
(setq listVPorts (mapcar 'car (vports))
      oldCmdEcho (getvar "CMDECHO")
      oldCVPort  (getvar "CVPORT"))

(setvar "CMDECHO" 0)
(if (and (setq pointBase (getpoint           "\nBase point: "))
         (setq pointMove (getpoint pointBase "\nNew point: ")))
 (foreach itemVPort listVPorts
  (setvar "CVPORT" itemVPort)
  (command "_PAN" pointBase pointMove)
 )
)

(setvar "CVPORT"  oldCVPort)
(setvar "CMDECHO" oldCmdEcho)
(princ)
)

 

 

kindly observe proper posting of codes...

must be inside quotes.

 

anyway, i did not get this error. still using it till now.

Im using AutoCAD 2014

Edited by SLW210
Posted

Yathishkumar, please pay attention that this tool is intended to be used for navigation in Model Space as per Nod684's request. Based on the error you received it appears that you attempted to use it in Paper Space.

Posted

Hi Msasu

 

i am using in paperspace viewports

 

first i click inside of one viewport and second viewport

then i type command pav

 

 

thanx

Posted

The tool was requested for Model Space viewports, so doesn't work in Paper Space. Sorry!

  • 4 months later...
Posted

MSasu,

 

How can I modify the code so that it will only pan the viewports in the current layout tab instead of trying to pan in all of the viewports in the whole drawing?

Posted

Hopefully this should fix it to be working as expected in all MS/PS situations...

 

;;; Pan in All Viewports (28-XI-2012)
(defun c:PAV ( / oldCVPort oldCmdEcho listVPorts pointBase pointMove )

(if (and (eq (getvar 'tilemode) 0)
         (eq (getvar 'cvport) 1))
 (command "_.MSPACE")
)

(setq listVPorts (mapcar 'car (vports))
      oldCmdEcho (getvar "CMDECHO")
      oldCVPort  (getvar "CVPORT"))

(setvar "CMDECHO" 0)
(if (and (setq pointBase (getpoint           "\nBase point: "))
         (setq pointMove (getpoint pointBase "\nNew point: ")))
 (foreach itemVPort (vl-remove 1 listVPorts)
  (setvar "CVPORT" itemVPort)
  (command "_PAN" pointBase pointMove)
 )
)

(setvar "CVPORT"  oldCVPort)
(setvar "CMDECHO" oldCmdEcho)
(princ)
)

Posted

New point: ; error: AutoCAD variable setting rejected: "CVPORT" 2/6/1

 

same error like cvport 1/2/6 for defendant layouts.

may be system variable.

but it's good tool.

 

 

thanks

yathishkumar

Posted

Thanks for the code Marko. It's alot closer to what I'm looking for but when I run it, the viewport that gets activated pans correctly. My other viewport however not so much. I know the reason is that my UCS is rotated in one of the viewports. Is there any way to take this into account? Right now to pan both viewports, I draw a line in paperspace, copy it so there's an identical line on top of both vports, then chspace the line into each vport and then use -pan command end select the end points of the line so the view pans the direction and distance equally.

 

Hopefully this should fix it to be working as expected in all MS/PS situations...

 

;;; Pan in All Viewports (28-XI-2012)
(defun c:PAV ( / oldCVPort oldCmdEcho listVPorts pointBase pointMove )

(if (and (eq (getvar 'tilemode) 0)
         (eq (getvar 'cvport) 1))
 (command "_.MSPACE")
)

(setq listVPorts (mapcar 'car (vports))
      oldCmdEcho (getvar "CMDECHO")
      oldCVPort  (getvar "CVPORT"))

(setvar "CMDECHO" 0)
(if (and (setq pointBase (getpoint           "\nBase point: "))
         (setq pointMove (getpoint pointBase "\nNew point: ")))
 (foreach itemVPort (vl-remove 1 listVPorts)
  (setvar "CVPORT" itemVPort)
  (command "_PAN" pointBase pointMove)
 )
)

(setvar "CVPORT"  oldCVPort)
(setvar "CMDECHO" oldCmdEcho)
(princ)
)

  • 2 years later...
Posted

Hello Guys, this is two years old, but a very useful thread! Thank you very much to all who contributed. I'd like to ask if the lisp could also correct same zoom between two MS viewports while it pans with the PAV?

Cheers!

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