Friday 18 November 2011

Tips on viewing your drawing

The faster you can display the section of your drawing where you need to work, the faster you can get started drawing and editing. With that in mind, here are some tips for viewing your drawing:

Use the mouse wheel

The mouse wheel is the key to fast view changes:
  • You can zoom in and out by rolling your mouse wheel. Roll away from you to zoom in, towards you to zoom out. Did you know that where you place the cursor determines the center of the zoom? You don’t have to click. Just move the cursor to the area of your drawing that you want to zoom in to, and zoom in with the mouse wheel.
  • You can do a Zoom Extents by double-clicking the mouse wheel.
  • You can pan by dragging (pressing and holding) with the mouse wheel. Tip: You can pan past the application window and even the edge of your screen. Just keep dragging the mouse cursor.
  • In 3D drawings, press Shift + the mouse wheel and drag do to a transparent 3D orbit.

Save a view

Saving views is especially helpful in large drawings. Set up the view that you want and then use the VIEW command to open the View Manager. Click New and enter a name. Click OK to accept the default of using the current view. Or choose Define Window to return to your drawing to define a view boundary. You can pan and zoom at the same time. Press Enter to return to the View Manager. Click OK to complete the process.
To display a saved view, again use the VIEW command. Choose the view from the list, click Set Current, and click OK.
You can open a drawing to a saved view. In the Select File dialog box, check the Select Initial View check box and click Open. The Select Initial View dialog box opens, where you can choose the view that you want to display when you open the drawing. Click OK.
Specifying an initial saved view when you open a drawing
Specifying an initial saved view when you open a drawing

Use the ViewCube

The ViewCube in AutoCAD 2010
The ViewCube in AutoCAD 2010
For 3D drawings, the new ViewCube is a handy way to change viewpoints. You just click on the face, edge or corner of the cube. You can also drag the ViewCube to make minor changes in your viewport; it’s not that different from 3D Orbit.
Has anyone found the Steering Wheel in 2010 useful?

Automate 3D views

In a comment on the post, Productivity Boost Ideas, someone asked about AutoLISP code for SE Isometric and other viewpoints. You can use the VPOINT command to automate these views. Here are the settings for the VPOINT command:
  • Top: VPOINT 0,0,1
  • Bottom: VPOINT 0,0,-1
  • Left: VPOINT -1,0,0
  • Right: VPOINT 1,0,0
  • Front: VPOINT 0,-1,0
  • Back: VPOINT 0,1,0
  • Southwest: VPOINT -1,-1,1
  • Southeast: VPOINT 1,-1,1
  • Northwest: VPOINT -1,1,1
  • Northeast: VPOINT 1,1,1

Flip objects with dynamic blocks

You can create dynamic blocks that you can easily flip after you insert them. This is great for doors which may open from the left or right, or open inward or outward. Dynamic blocks were introduced in AutoCAD 2006.
Follow these steps to create a door that flips both ways:
Start with a door block, like this one. You might want to insert it into a new drawing. You don’t need to explode it; when you open it in the Block Editor, you’ll have access to all the individual components, as if you had exploded it. That’s one of the great features of dynamic blocks; you can work with complex blocks that contain many components and individually program each component.

Choose Block Editor from the Standard toolbar (the BEDIT command). Here’s what you see.

Note that the Block Editor has its own toolbar. It also has its own UCS icon. This is very important, because 0,0 in the Block Editor will be the insertion point of the block. When you open the block in the Block Editor, its insertion point will be at 0,0 in the Block Editor, like this:

The first flip action we’ll create will be like mirroring with a vertical mirror line; it will flip the door to the left or right. Unflipped, the door will be as you see it here, which means it opens from the right to the left. Flipped, the door will open from the left to the right.
Click the Parameters tab of the Block Authoriing Palettes window and choose Flip Parameter. At the Specify base point of reflection line or [Name/Label/Description/Palette]: prompt, choose the Label option. This option lets you customize the label. It’s important to change it, because we’ll have two flip parameters when we’re done. Enter Flip Left/Right.
You can also customize the names for both states (which appear in the Properties palette). so the next thing you see is this prompt:
Specify values for items in the flip property dropdown control:
Enter flip property value for an unflipped state <Not flipped>:
Enter flip property value for a flipped state <Flipped>:
You can leave the defaults (Not flipped and Flipped), but instead, enter Opens at right for the unflipped state and enter Opens at left for the flipped state. Later, when you select the block, you can see which state you have in the Properties palette.
You can change these values at any time by selecting the parameter and using the Properties palette.
Now the original prompt returns. Specify base point of reflection line or [Name/Label/Description/Palette]: Specify the midpoint of the bottom horizontal line of the door.
Specify endpoint of reflection line: Specify any point 90° above the midpoint, to make a vertical flipping line.
Specify label location: Place the label above the door.

Notice the exclamation point. That tells you that you haven’t completed the process of flipping the door. That’s because most parameters also require a corresponding action.
Click the Actions tab of the Block Authoring Palettes window and choose Flip Action. A Flip action always goes with a Flip parameter.
At the Select parameter: prompt, select the parameter you just added.
At the Select objects: prompt, select all the objects of the door. In this situation, you can include the parameter, too.
At the Specify action location: prompt, place the action, usually near the parameter label. It doesn’t show in your drawing, so it’s just for your convenience when editing the block in the Block Editor.
You can change the action’s name. Select it and change the Action Name value in the Property palette to Flip left/right action. I find it helpful to distinguish the parameter label from the action name. Our door now looks like this in the Block Editor.

Click Save Block Definition on the Editor’s toolbar (the 2nd button from the left). To try it out, click Close Block Editor. If you already have inserted an instance of the block in the drawing, you get a message about it. Click Yes.
To test the block, choose Insert Block from the Draw toolbar and choose the block. In the Insert dialog box, you should see that yellow lightning icon in the preview box, to show that it’s a dynamic block. Make sure that only the Insertion Point Specify On-Screen check box is checked and click OK.
Specify the insertion point in your drawing to insert the block. To flip it, select it and you’ll see the turquoise flip grip on the block. Click the grip to flip the door. Click it again to flip it back.
Watch the process in an AVI file.
When you’re satisfied, open the Block Editor again, choose the block and click OK. Now you need to add the flip for the other direction.
Again, click the Parameters tab and choose Flip Parameter. At the Specify base point of reflection line or [Name/Label/Description/Palette]: prompt, pick the midpoint of the right side of the door — the short side. You may have to zoom in to do this.
At the Specify endpoint of reflection line: prompt, move the cursor to the left and pick any point 180° from the first point (creating a horizontal mirror line).
At the Specify label location: prompt, pick a point to the right of the door, or perhaps just beneath it.
Tip: When you zoom in and out, sometimes the size of the labels gets out of synch. Click the Update Parameter and Action Text Size button on the Editor’s toolbar.
Select the parameter. In the Properties palette, change the label to Flip in/out.

Click the Actions tab and choose Flip Action. At the prompt, select the parameter you just created.
At the prompt to select objects, select the door. Not only can you select this action’s parameter, but you can select everything else (which makes it easy).
If you want, change the name of the action in the Properties palette. I changed it to Flip in/out action. Here’s the final dynamic block in the Block Editor.

Avoid drawing temporary construction lines

When you need to draw a line that doesn’t start on a geometric point (endpoint, midpoint, etc.) of another object, you might draw a temporary line, called a construction line, from an existing object to the desired start point of the new line.
Then you would draw the new line. Then erase the construction line.
This is so very 70′s, left over from hand drafting days! Instead you can use other drafting tools to start your new line more quickly and avoid the erasing process. (How many of you have forgotten to erase that line?)

The From object snap

From isn’t really an object snap, but it lets you start lines a certain x,y offset from an existing point. Use it when you know the x and y distances from some point.
Let’s say that you have a rectangle, the outer edge of a window frame, and you want to draw the glass pane as another rectangle inside the first one. You might draw a line 3,2 units from the lower-left corner so that you have an endpoint from which to start your inside pane.
Instead, here’s what you should do:
1. Draw the first rectangle.
2. Start the RECTANG command for the second rectangle.
3. At the RECTANG prompt, type from and press Enter. (There are other ways to get to it, but typing it is the fastest.)
4. At the Base point: prompt, use an OSNAP to specify the lower-left corner of the first rectangle.
5. At the <Offset>: prompt, enter the offset, such as @3,2. Your rectangle starts in the right place.
IMPORTANT: You must put the @ before the offset, even if you’re using the default relative coordinates.

Toggling the display of grips within blocks

By default, when you select a block, AutoCAD displays only one grip, at the block’s base point. However, what if you want to grip edit the block from some other point in the block. You can do so by displaying the grips of all the objects in the block. Jack Foster sent in a great AutoLISP routine that easily toggles between these modes. To use it, type the following at the end of your acad.lsp file (or create the file if it doesn’t exist and put it in your AutoCAD’s  \Support folder).
(defun c:gb()
(setvar “gripblock” (abs(1- (getvar “gripblock”))))
)
This will load automatically when you start AutoCAD. Then simply type gb to run the routine. Each time you use gb, the routine toggles the GRIPBLOCK system variable setting. Here you see the results of both settings.

Jack notes that you can use the same method to toggle other system variables that use 0 and 1 as their two values, such as tilemode.


Getting back the R14 full-screen cursor

AutoCAD 2000 sets the default for the cursor at 5% of the screen. Many people like the old full-screen cursor. Abdul Nazar emails from India that you can change the cursor using this prompt.
Command: cursorsize
Enter new value for CURSORSIZE <5>: 100
You can also choose Tools>Options and click the Display tab. There you can type in a new cursor size or use the slider bar.
Bob Abernethy contributed a short AutoLISP file that toggles the cursor size from 5% to 100% and back again. He includes a bitmap file that you can use for a toolbar button.

How to rotate the crosshairs and other techniques for drawing at an angle

Rotate the crosshairs

  • Thanks to Garry Stack of CADCO in Cork, Ireland for his tip suggesting this method. He likes it better because he finds that the tracking guides get in the way. To rotate the crosshairs, right-click the SNAP button on the Status bar and choose Settings. Type a value, such as 45° for the Angle and click OK. Now your crosshairs are at that angle. However, you need to use ORTHO to use direct distance entry using this method. Garry suggests making toolbar buttons for commonly used angles. For example, the macro to rotate the crosshairs 45° would be ‘snapang;45; I think it would be useful to have a ‘snapang;0; toolbar button as well. Lots of people seem to like this tip. Jack Foster writes that he has a button with the following macro: snapang;0;;\ This sets the snap angle to 0 regardless of what it currently is, then goes back to the snapangle variable and waits on the user to type in the new angle you want. Matt Doyle likes this version: ^C^Csnap;r;\\;off; This lets you set the angle by picking two points, then shuts off the snap command (which otherwise is turned on and snaps you to the grid). Ian Matthews contributed this pair:
    ‘snap r 0,0;per;
    ‘snap r ;0;
    The first one matches the cursor of a line you select. The second one returns the snap angle back to 0. He puts these on two toolbar buttons.
  • Jon Jonas prefers using the command prompt, so he defines two commands using AutoLISP:
(DEFUN C:SNR ()
(SETQ PT1 (GETPOINT “\nSELECT ORIGIN POINT: “))
(SETQ PT2 (GETPOINT “\nSELECT POINT ALONG ROTATION: “))
(COMMAND “SNAP” “RO” PT1 PT2)
(COMMAND “SNAP” “OFF”)
)
(DEFUN C:SN0 ()
(COMMAND “SNAP” “RO” “0,0″ “1,0″)
(COMMAND “SNAP” “OFF”)
)
He explains, “SNR sets the snap angle up using 2 points while SN0 (S-N-Zero) resets it back to zero… Simply place it in the acad.lsp file and you are good to go.”
  • Nick Louis says, to change your crosshair angle, just type in snapang at the command prompt, then hit Enter. Now simply type the angle you want. Or, type the code below in your acad.lsp file and reload the acad.lsp file. Then just type sa for Snap Angle.
(DEFUN C:sa ( ) (COMMAND “snapang”))

Create a User Coordinate System (UCS)

  • To rotate the axes by 45°, choose Tools>New UCS>Z and type 45. Press Enter. (Or, as Jimmy Wesley suggests, type ucs, z and type 45.) You can use Polar Tracking with this UCS if you wish. Typing relative coordinates will be simplified (for example, @3,0 instead of @3<45). Jimmy further suggests a quick way to return to the default axes: type ucs and press enter twice. Andrew Hudson suggests creating your UCS this way. Draw a line at the angle you need, such as 7.6 degrees. Choose Tools > New UCS > Object. At the prompt, pick the line nearest the end that you want to be your new 0,0 point. Alan Praysman has a custom toolbar button that works as a toggle to rotate the UCS and then restore the WCS. To rotate the UCS, click the button and pick the endpoints of a line to specify the angle. Here’s the code:
(if (equal (getvar “ucsxdir”) (list 1.0 0.0 0.0))(command “ucs” “new” “z”)(command “UCS” “world”));
  • Alan Ball from Auckland, New Zealand submitted: “I find the easiest way is to use the UCS command and type in 3. The command then asks for the 0,0,0 point and the X and Y axes. The 3 option vanished from the options shown as available with the UCS command a few years back, but is still available to use and is very handy if you don’t know the angle…you are working with.

AutoCAD tutorial: Attach an xref

Why use xrefs?

  1. Xrefs keep your drawing smaller.
  2. Each time you open a drawing, AutoCAD loads a current copy of the xref, so that you always have the most updated version. The drawing contains a link to the xref, so you don’t have to worry if what you’re seeing is outdated.
  3. You can attach and detach xrefs easily. You can also load and unloaded them to display or hide them, without losing the connection.
Xrefs are ideal for times when you need to reference another drawing but don’t want the relationship to be permanent. They are also ideal for situations in which multiple people work on a drawing. For example, both an electrician and a plumber might add an architect’s plans to their drawing as an xref.

Attach an xref

Follow these steps to attach an xref:
  • Choose Insert tab> Reference panel> Attach (the ATTACH command) to open the Select Reference File dialog box. (In earlier releases, this was the XATTACH command.)
  • Make sure Drawing (*.dwg) is visible in the Files of Type drop-down list in the dialog box. If not, click the list and choose it.
  • Navigate to the drawing you want to attach, choose it and click Open. The Attach External Reference dialog box appears.

  • Set the Reference Type to Attachment (the default). If you want, you can specify the scale, insertion point, and rotation in the dialog box. Click OK.
  • If you used the settings you see in the dialog box here, you’ll be prompted for an insertion point. You’ll see an image of the xref, so you can place it by eye if you want. Click to place the xref.
Notes:
  1. An overlay is useful when you’re sharing drawings over a network. If someone else attaches your current drawing, that person doesn’t see the overlay, only the main drawing.
  2. In the Scale section, you can check the Uniform Scale checkbox to ensure that the Y and Z values are always the same as the X value. This ensures that the xref isn’t distorted from its original ratios.