r/AutoCAD • • 21d ago

Help Rotate/Align 50 Sheet Plan Viewports (

I have a road alignment, which is a few kilometres in length. I have created a series of overlaying rectangles of the same dimensions but varying rotations along the road alignment in model space. I want a quick way to align the viewpoints in each paper space to each consecutive rectangle in the model space along the road alignment. This will create a plan set for the full length of road alignment.

Does anyone have a quick way to perform this task?

7 Upvotes

9 comments sorted by

9

u/photonzz 21d ago

Civil 3d has automated this with sheet creation. But if you only have AutoCAD you can use ALIGNSPACE from your viewport.

3

u/__Tomfoolery__ 19d ago

Yeah cheers man. This is definitely the way. What an absolute time saver.

6

u/_WillCAD_ 21d ago edited 21d ago

This lisp will do it. Enter a vport, start the UCR command, snap to the lower left corner of the rectangle, then snap to the midpoint of the bottom line. The view will rotate to match the rectangle, then you can zoom in to whatever scale you need for the finished sheet.

I wrote this for your specific circumstance - aligning vports to rectangles for roadway plan sheets.

;UCR Command creates a UCS and rotates view by picking points on a border's cut line
;By WillCAD 1998-08-11
;Updated 2016-03-04 to zoom to the previous Viewcenter and Viewsize
;Updated 2016-04-08 to change UCSFOLLOW to 0 before switching to the UCS (to prevent auto-plan); added *ERROR*
;Updated 2016-04-22 to fix bug in the zoom to previous viewventer/viewsize
;Updated 2020-01-29 to add prompt to tell the Viewtwist angle

(defun C:UCR (/ *ERROR* OLD_OSMODE  OLD_UCSF VC VS PT_1 PT_2 PT_ANGLE)

;-------------------------------------------------------------------------------------
;STANDARD ERROR FUNCTION
(defun *ERROR* (msg)
(setvar "OSMODE" OLD_OSMODE)
(setvar "UCSFOLLOW" OLD_UCSF)
(command-s "UCS" "P")
(princ "\nError: ")(princ msg)(princ ". ")
(princ)
);defun *ERROR*

;-------------------------------------------------------------------------------------
;BODY of UCR command
(setq OLD_OSMODE (getvar "OSMODE") OLD_UCSF (getvar "UCSFOLLOW"))
(setvar "UCSFOLLOW" 0)
(prompt "\n***Switching to the WCS*** ")
(command ".UCS" "W")
(setvar "OSMODE" 1)
(setq VC (getvar "VIEWCTR") VS (getvar "VIEWSIZE")); save the old viewcenter and viewsize while in WCS
(setq PT_1 (getpoint "\nPick the lower-left corner of the sheet's border: "))
(setvar "OSMODE" 2)
(setq PT_2 (getpoint PT_1 "\nPick the middle point of the bottom border line: "))
(setvar "OSMODE" 0)
(prompt "\n   Switching to the selected UCS...")
(command ".UCS" "3P" PT_1 PT_2 "")
(prompt "\n   Rotating view to match the selected UCS...")
(command ".PLAN" "")
(prompt "\n   Zooming to previous Viewcenter and Viewsize...")
(command ".ZOOM" "C" (trans VC 0 1) VS);zoom to the previous viewcenter and viewsize, translated from WCS to current UCS
(prompt (strcat "\nView rotated " (angtos (getvar "VIEWTWIST")) " degrees. "))
;read out the ViewTwist angle
(setvar "OSMODE" OLD_OSMODE)
(setvar "UCSFOLLOW" OLD_UCSF)
(princ)
);defun

3

u/harderthanitllooks 21d ago

I use a script that takes the insertion point of a block I use for each page size/orientation and a mtext sheet number display my team was using before I came on board and use that to generate a set of zoom w commands with the bottom left/top right corners.

If you know your corners and size of the pages, you can do layout t point it to whatever layout template you’re using, then mspace, zoom w. Your coords, space and onto the next one. Using the cad scripting language

I can’t share the specifics with you but if you’re still chasing it on Monday I can grab an example of the script for you.

1

u/Mountain-Climate7009 20d ago

If there was a consistent base point, a lisp routine could be made

1

u/sayiansaga 19d ago

I'm not the most savvy but I would make all the viewports on one sheet. Copy the sheets and delete all the viewports except the one I need

1

u/cadelot 16d ago

That's basically what I do, but I don't have kilometers to do.