DVIEW with a Twist: Rotating a Viewport View

DviewWithTwist

Not everything that we draft or model in AutoCAD is at 90 degree increments. For this reason when we want to make our model aligned with the sheet of paper.

Shown below is a house that has 2 major axis. One axis happens to be aligned on the zero degree axis and the other is not. And it so happens that the portion that is not aligned to zero needs to have a viewport aligned to it and dimension applied to it.

Side Note: A simple approach that might be applicable can be found here: VPROTATEASSOC. This method rotates the entire viewport and the view of objects shown in the viewport.

DVIEW1

 

The method of rotating the view within a viewport that is described in this post is called “DVIEW with a Twist”. And it should be noted that this does not rotate any objects thus modifying any of the objects. It merely rotates the view of the objects.

Before we begin, you will need to find out the angle that the view will be rotated by. We will need to do this seperately because there is not an option for a reference like there is in the Rotate command (shown here)

To find out the angle of the existing objects, use either the LIST or DISTANCE (aliases: LIST = LI, DISTANCE = DI) command on an objects that represents the desired angle. In the picture shown below, I used the DISTANCE command and picked 2 points. Then I noted the angle that is shown in the command line.

DVIEW2-A

 

Open the Quick Calculator by using any of the following:

  • QC <enter>
  • QUICKCALC <enter>
  • CTRL + 8

Because the view needs to be rotated is in the positive direction (counter-clockwise), the angle that was noted from the “Distance” command will be subtracted from 360.

Copy this total to your clipboard by highlighting it and then right click > copy

 

 

DVIEW4

We can now start the DVIEW command

Before you launch the DVIEW command, activate the viewport and make sure that the viewport is unlocked (shown below)

DVIEW2

 

  • DVIEW <enter>

DVIEW6

  • Select objects that are to be included in the “Twist” operation by using a window or crossing selection.
  • hit <enter> when finished selecting objects

DVIEW5

 

  • Specify the angle to rotate the view. If you know the angle enter it in the command line. If you used the QuickCalc and copied it to the clipboard, simple paste it into the command line and hit enter.

Note that the center point of rotation is located at the center of the viewport, not the center of the objects selected.

Also note: If the angle of rotation needs to be a clockwise rotation, you simply apply a minus sign in front of the angle. Ex. -45 will rotate the view in the clockwise rotation 45 degrees.

DVIEW7

 

The portion of the building that was earlier at an odd angle is now lined up at zero degrees. You can now center that portion of the building in the viewport and set the viewport scale to begin placing dimensions and text in paperspace.

DVIEW8

Advertisements

About AutoCAD Tips

This blog serves as a knowledge base for myself (and anyone else) so that I can reference tips & tricks that I have learned and also refer others to it as well. I hope that this blog helps you learn at least one tip to make your drafting/design experience better.
This entry was posted in BASICS, Dimensions, Layout, Modifying, Paper Space, TIPS. Bookmark the permalink.

12 Responses to DVIEW with a Twist: Rotating a Viewport View

  1. Nick says:

    ALIGNSPACE has been used more in our office for rotating a viewport

  2. MurrayC says:

    Years ago I wrote a lsp routine called “TWIST” which uses the DView command, etc. The neat part about the routine I wrote is that if you already have the model-space contents positioned and scaled accordingly within the viewport, it rotates the view about the centerpoint of the viewport while retaining the position and scale factor.

    I’d be willing to share the routine.

  3. AutoCAD Tips says:

    Please share. The more options or ways of doing a task – the more fun. At least, that’s how I think about it. Especially if it is automated via a script or LISP
    ~Greg

  4. MurrayC says:

    Here you go…

    ;;;TWIST.lsp takes out the guess work of rotating the current viewport display.

    ;;;When using the command DVIEW, TWist, you either HAVE to know the exact angle to rotate the display to,
    ;;;or, you have to eyeball what the angle will be.

    ;;;This routine takes away ALL the guess work by allowing you to pick two points along an object
    ;;;which will make that angle horizontal to the current viewport display

    ;;;written and copyright by Murray Clack

    ;;;September 5, 2002

    ;;;Modified August 28, 2003

    (defun c:TWIST (/ AB SA OM AUP AU AN ANG ANG2) ;;;define command and variables

    (setvar “cmdecho” 0) ;;;turns off command echo

    (setvar “ucsfollow” 0) ;;;turns off ucsfollow

    (setq AB (getvar “angbase”)) ;;;saves current angbase

    (setvar “angbase” 0) ;;;sets angbase to 0

    (setq SA (getvar “snapang”)) ;;;saves current snapang

    (setvar “snapang” 0) ;;;sets snapang to 0

    (setq OM (getvar “orthomode”)) ;;;saves current orthomode

    (setvar “orthomode” 0) ;;;turns orthomode off

    (setq AUP (getvar “auprec”)) ;;;saves the angle units precision

    (setvar “auprec” 8) ;;;sets the angle unit precision to a higher value

    (setq LUP (getvar “luprec”)) ;;;saves the linear units precision

    (setvar “luprec” 8) ;;;sets the linear unit precision to a higher value

    (setq AU (getvar “aunits”)) ;;;saves the angle units

    (setvar “aunits” 0) ;;;sets the angle units to decimal

    (command “.ucs” “”) ;;;set the UCS to world

    (setq AN (getangle “\nPick angle of alignment to make HORIZONTAL to current viewport display: “)) ;;;saves Radian angle

    (setq ANG (cvunit AN “radian” “degree”)) ;;;converts radian angle to decimal angle

    (setq ANG2 (- 360.0 ANG)) ;;;determines angle to be set to world

    (command “.dview” “” “tw” ANG2 “”) ;;;twists the viewport display to new angle

    (setvar “aunits” AU) ;;;resets the previous angle units

    (setvar “angbase” AB) ;;;resets the previous angbase

    (setvar “auprec” AUP) ;;;resets the previous angle unit precision

    (setvar “luprec” LUP) ;;;resets the previous linear unit precision

    (setvar “orthomode” OM) ;;;resets orthomode

    (setvar “snapang” SA) ;;;resets snapang

    (command “.ucs” “V”) ;;;sets the UCS to the current view

    (princ) ;;;exit command quietly

    ) ;;;that’s all folks

  5. AutoCAD Tips says:

    Thanks for sharing – i will try it out later
    Thanks again
    ~Greg

  6. Pingback: Use Align Space to Easily Align A Viewport View | AutoCAD Tips

  7. Dave Hein says:

    I like the ALIGNSPACE command… I’ve actually never used it. I haven’t used DVIEW either. But I have had many cases where I’ve needed to rotate a view in a vport where MVSETUP was my go-to command. Invoke it with the Align and Rotate options and then click a point in the model. It does require you know the angle, but it’s another way to skin this same cat. :) Of all of these, ALIGNSPACE is by far the most efficient method. Thanks!

  8. CAD DADDY says:

    WHY NOT JUST USE UCS 3 POINT ROTATION

  9. rashid says:

    Thanks for the tip and was use full

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s