nod684 Posted November 28, 2012 Share Posted November 28, 2012 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? Quote Link to comment Share on other sites More sharing options...
Tiger Posted November 28, 2012 Share Posted November 28, 2012 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 Good question though, I will move this to the lisp-forum and hope you get a good answer (that I can use too!) Quote Link to comment Share on other sites More sharing options...
MSasu Posted November 28, 2012 Share Posted November 28, 2012 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) ) Quote Link to comment Share on other sites More sharing options...
nod684 Posted November 29, 2012 Author Share Posted November 29, 2012 (edited) Thanks a lot Mircea! working as i want it to be... this will be useful. thanks again Edited November 30, 2012 by nod684 Quote Link to comment Share on other sites More sharing options...
nod684 Posted November 29, 2012 Author Share Posted November 29, 2012 Thanks Tiger! sorry for the dots. don't know about that. its just am not sure if my question is possible thanks again. Quote Link to comment Share on other sites More sharing options...
Tiger Posted November 29, 2012 Share Posted November 29, 2012 no worries Nod, it's just a bug, nothing that is widely known. Quote Link to comment Share on other sites More sharing options...
MSasu Posted November 29, 2012 Share Posted November 29, 2012 Glad to hear that you found that useful, nod684! You're entirely welcome! Quote Link to comment Share on other sites More sharing options...
yathishkumar Posted October 18, 2014 Share Posted October 18, 2014 thank you Quote Link to comment Share on other sites More sharing options...
yathishkumar Posted October 18, 2014 Share Posted October 18, 2014 (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 October 20, 2014 by SLW210 Added Code Tags Quote Link to comment Share on other sites More sharing options...
nod684 Posted October 18, 2014 Author Share Posted October 18, 2014 (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 October 20, 2014 by SLW210 Quote Link to comment Share on other sites More sharing options...
MSasu Posted October 20, 2014 Share Posted October 20, 2014 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. Quote Link to comment Share on other sites More sharing options...
SLW210 Posted October 20, 2014 Share Posted October 20, 2014 Please read the Code Posting Guidelines. I fixed for you this time. Quote Link to comment Share on other sites More sharing options...
yathishkumar Posted October 21, 2014 Share Posted October 21, 2014 Hi Msasu i am using in paperspace viewports first i click inside of one viewport and second viewport then i type command pav thanx Quote Link to comment Share on other sites More sharing options...
MSasu Posted October 21, 2014 Share Posted October 21, 2014 The tool was requested for Model Space viewports, so doesn't work in Paper Space. Sorry! Quote Link to comment Share on other sites More sharing options...
odindargon Posted March 3, 2015 Share Posted March 3, 2015 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? Quote Link to comment Share on other sites More sharing options...
marko_ribar Posted March 3, 2015 Share Posted March 3, 2015 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) ) Quote Link to comment Share on other sites More sharing options...
yathishkumar Posted March 4, 2015 Share Posted March 4, 2015 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 Quote Link to comment Share on other sites More sharing options...
odindargon Posted March 4, 2015 Share Posted March 4, 2015 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) ) Quote Link to comment Share on other sites More sharing options...
mikitari Posted October 5, 2017 Share Posted October 5, 2017 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! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.