Chapter 19

Call the Parametrics!

IN THIS CHAPTER

Bullet Introducing parametric drawing

Bullet Understanding constraints

Bullet Applying geometric and dimensional constraints

Bullet Editing parametric drawings

A few releases back, AutoCAD added a set of parametric drawing tools, and, offhand, I can’t think of a more significant new feature in recent years. In fact, if you work primarily in 2D, and especially if you’re in the manufacturing business, parametrics in AutoCAD (and, to a very limited degree, in AutoCAD LT) might just be the most significant new feature ever since the beginning of orthographic engineering drawings, generally attributed to the Roman architect Marcus Vitruvius in the 1st century BC. Contrary to popular opinion, I am not so old that I knew him personally.

Parametric tools allow you to create relationships between geometry in a drawing. These relationships help to constrain and restrict changes to a design. If you know what I’m talking about, you’re probably pretty interested in finding out more about what you can do with parametrics in AutoCAD. If, on the other hand, you think parametrics are the folks who show up when you dial 911, the following paragraphs should straighten you out.

Imagine this scenario: Your boss has been in a meeting all morning with an important client. At two minutes before noon, they emerge. Your boss hands you a marked-up printout and rather imperiously commands you: “We need these 12 dimensions changed and the drawing updated by the time we return from lunch.” The drawing involves multiple views, several cross sections, and a couple of details at different scales.

By the time the pair put on their coats, you’ve met them at the door and handed them a printout of the revised drawing. The client invites you to join them for lunch.

This chapter shows you how to make this scene happen in real life.

Maintaining Design Intent

Parametric (rule-based) drawing is by far the best way to enforce design intent in 2D drafting. Design intent in AutoCAD (or in any other engineering software) means that when drawings are edited to make “this part” wider and “that hole” larger, all the attached or related objects behave in a predictable way that honors the designer’s intentions in creating the drawing.

Before AutoCAD 2010, there was simply no practical way to maintain the design concepts behind an AutoCAD drawing. You could use AutoCAD drawing and editing commands to draw accurate, precise plans, sections, and details, but they were, to AutoCAD, simply a bunch of lines and circles.

Suppose that an engineer has taken a second look at a baseplate (see Chapter 3) and determined that its 1-1/2” bolts should be changed to 1-3/4”. To revise the drawing by using AutoCAD in the traditional way, you draw a new, larger circle for the bolt and erase the old one. Now the nut is too small, and so is the hole in the plate. Maybe you can’t see it, but you know — and I know — that it’s there. And you have four bolts to change — that’s a whole lot of editing to fix this drawing. Even so, the good news is that it would still be a lot easier than using paper and pencil.

In AutoCAD, you can add some intelligence to those lines and circles by applying parametric constraints to them. Rather than try to explain what this term means, I show you.

AutoCAD does not support 3D constraints, such as those found in Inventor.

Unfortunately, the following exercise doesn’t work in AutoCAD LT.

Follow these steps to use parametrics to constrain a line to a circle:

  1. Start a new drawing.
  2. Draw a circle and a line anywhere in the drawing.

    Specifying exact sizes and alignments isn’t critical. You’ll see why in a moment, and I explain even more a little later in this chapter.

  3. Apply a tangent constraint between the circle and the line.

    Screen capture depicting Tangent icon. Parametric functions are found on the Ribbon’s Parametric tab. Nothing in AutoCAD should surprise you by now. Click the Tangent button, and then select the circle and the line. The sequence doesn’t matter. Observe how they move until they’re tangent to each other and how a little gray icon (a constraint bar) appears to indicate the type of constraint. Note that tangent doesn’t necessarily mean that they touch.

  4. Grip-edit the line and the circle.

    You can move the circle or line, change the diameter of the circle, or move either end of the line — but no matter what you do, the other object obediently remains tangent. I cover grip editing in Chapter 11.

  5. Apply a diameter dimension to the circle.

    Screen capture depicting Diameter icon. Don’t use the normal DimDIameter command, described in Chapter 14. Instead, click the Diameter button in the upper-right corner of the Dimensional panel of the Parametric tab on the Ribbon. When you select the circle as prompted, AutoCAD places a funny-looking gray dimension that reads something like this: dia1=5.3716. It has the same background color as the mText edit box (see Chapter 13); in fact, that’s exactly what it’s inviting you to do. When you enter the desired diameter (say, 7.5), the circle resizes to match the diameter value you entered, and the line adjusts to remain tangent. Magic! It’s the opposite of associative dimensions (see Chapter 14).

  6. Apply an aligned dimension to the line.

    Screen capture depicting Aligned icon. Again, be sure to click the Aligned button from the Dimension panel on the Parametric tab, and select each end of the line in turn or press Enter and then select the line. This time, when it places the dimension, enter =dia1*2 including the equal sign and omitting spaces. The line automatically resizes to become twice as long as the diameter of the circle.

  7. Double-click the diameter dimensional constraint and type a new value, such as 5, and press Enter.

    Surprise! The circle size changes, and the line changes its length so that it’s still twice as long as the new diameter of the circle. That is one smart drawing. Imagine a similar effect on your productivity in creating and editing drawings.

    You can still grip-edit the position of the line and circle, but you can’t change the diameter of the circle or length of the line using grip editing, nor can you stretch the line length any more.

Defining terms

The word parameter is derived from these two Greek roots:

  • para: To work with, to assist, to work alongside. Think of paramedic ambulance attendants. You may have seen an “ambulance” when I mentioned parametrics earlier in this chapter.
  • metros: To measure (hence meter and metric). For the purposes of making drawings in AutoCAD, a parameter is a rule that works alongside AutoCAD objects. You can think of parametric drawing as rule-based drawing.

AutoCAD’s parametric rules (officially called constraints) fall into two categories:

  • Geometric: Based on object types and relationships between objects; different object types have different potential constraints. In the example in the preceding step list, I show you how to apply a Tangent constraint between the line and the circle — as you move or change one, the other one follows along.
  • Dimensional: Based on dimensioned distances on or between objects or points on objects. In the earlier example, you see how to apply a dimensional constraint to the circle. Changing the dimension value changes the circle size. Better yet, you can establish a relationship between the circle and the line so that changing the circle diameter also changes the length of the line.

Both AutoCAD and AutoCAD LT support constraints, but (as is usually the case) the feature is limited in LT. If you use the full version of AutoCAD, you can create and modify geometric and dimensional constraints, as I describe in the steps in this chapter. If you’re using LT, you can’t create either type of constraint, but you can work with existing constraints in drawings that were created in AutoCAD. Figure 19-1 shows the difference between the AutoCAD and AutoCAD LT Parametric tabs.

Image described by caption and surrounding text.

FIGURE 19-1: Parametric tabs in AutoCAD (top) and AutoCAD LT (bottom).

Tip If you’re using AutoCAD LT, or if you just want to check out some ready-made parametric possibilities, you can download the sample drawing datasets from either www.autodesk.com/autocad-samples or www.autodesk.com/autocadlt-samples. The parametric samples are architectural_example-imperial.dwg, civil_example-imperial.dwg, and mechanical_example-imperial.dwg.

Forget about drawing with precision!

“Are you serious? Throughout this book, you continually nag about the need for drawing with precision, and now you want me to forget about it?”

I’m sure that you’re familiar with, or at least have come across, computer acronyms and abbreviations, such as RAM, ROM, DVD, USB, and, of course, CAD. Okay, here’s a new one that I coined for a magazine article a few years back: NAD, or Napkin-Aided Design. It has been my observation that the vast majority of design projects start life as a sketch on a coffee-shop napkin.

A major strength of CAD is that drawings can (and should) be so precise that you can make use of information within them, such as areas. A major weakness of CAD is that you’re forced to be precise, even early in the design process, when circumstances often change. Yes, commands such as Move and Stretch make editing relatively simple, but relatively is a relative term, and easy to use is easy to say.

With parametrics, you can start out with a NAD sketch that shows the general idea of your design. Remember my parametric motto: Close enough is good enough. By the way, the motto also applies to horseshoes, hand grenades, and dancing. Then apply geometric and dimensional constraints and formulas to control the behavior of the drawing, and fine-tune the values until you arrive at your final design.

Constrain yourself

You can apply dimensional or geometric constraints to new geometry as you create it, or you can assign constraints to existing geometry in old drawings. You can even convert existing associative dimensions to dynamic dimensional constraints. The following sections describe the constraints available in each of the two categories. I start with geometric constraints because I’ve found that it’s usually best to pin down objects (pun intended) before applying dimensional constraints so that the drawing objects behave in a predictable manner when dimension values are changed.

Understanding Geometric Constraints

Adding geometric constraints to object geometry is quite simple because it’s much like using normal object snaps. In fact, in several cases, AutoCAD’s geometric constraints have equivalent object snaps. AutoCAD has tangent, parallel, concentric (center), and perpendicular object snaps, and there are tangent, parallel, concentric, and perpendicular geometric constraints. The difference between these relations as object snaps and as geometric constraints is that constraints are persistent. Think of them as “sticky” object snaps, as opposed to the “momentary” ones described in Chapter 8.

For example, in the example earlier in this chapter, you can see how the line always remains tangent to the circle, no matter what. The objects “remember” how to get along with their siblings. If I could only figure out a way to make this principle work with my kids.

Twelve geometric constraints are at your disposal to apply to drawing objects, and the easiest way to apply them is to click buttons on the Geometric panel of the Ribbon’s Parametric tab. Table 19-1 presents a list of the geometric constraints and explains what they do.

TABLE 19-1 Geometric Constraints

Button

Constraint Name

What It Does

Image described by caption and surrounding text.

Coincident

Forces two or more points, such as endpoints or midpoints, to coincide; can also constrain a point to lie anywhere on an object.

Image described by caption and surrounding text.

Collinear

Forces two or more lines to lie along an infinitely long projection of the first line that’s selected.

Image described by caption and surrounding text.

Concentric

Forces the centers of two or more arcs, circles, ellipses, or arc segments of polylines to share the same center point.

Image described by caption and surrounding text.

Fix

Locks the location of an object or a point on an object to a specific location in the drawing; object can rotate around the fixed point.

Image described by caption and surrounding text.

Parallel

Forces two lines to be parallel; the second line selected becomes parallel to the first line.

Image described by caption and surrounding text.

Perpendicular

Forces two lines to be perpendicular to one another. Note that perpendicular doesn’t mean only “one horizontal with the other one vertical at one end.” Perpendicular means “at right angles to” no matter the angular orientation, and the lines do not need to touch or cross.

Image described by caption and surrounding text.

Horizontal

Forces a line or two points to be horizontal relative to the current coordinate system.

Image described by caption and surrounding text.

Vertical

Forces a line or two points to be vertical relative to the current coordinate system.

Image described by caption and surrounding text.

Tangent

Forces an object to be tangent to a selected arc or circle. Lines can be tangent to arcs and circles, and arcs and circles can be tangent to each other.

Image described by caption and surrounding text.

Smooth

Joins a selected spline object with another spline, line, arc, or polyline while maintaining curvature (also known as G2) continuity.

Image described by caption and surrounding text.

Symmetric

Forces two objects or two points on objects to be symmetrical about an imaginary line and is similar to a persistent Mirror command.

Image described by caption and surrounding text.

Equal

Forces two lines or linear polyline segments to be the same length; forces two arcs or circles, or an arc and a circle, to have the same radius.

Tip Text objects can also be geometrically constrained. You can apply horizontal or vertical constraints to text, and you can make text parallel, perpendicular, or collinear with lines. Anyone who has had to label utility lines on civil engineering drawings in earlier releases so that the text aligns with the linework will enjoy this feature.

The three buttons at the right side of AutoCAD’s Geometric panel (and the only buttons on AutoCAD LT’s Geometric panel) let you control the visibility of geometric constraint markers:

  • Show All shows all constraint markers.
  • Hide All hides all constraint markers.
  • Show/Hide displays the constraints on selected objects. I wish that you could hover the mouse pointer over an object to show the constraints, but you need to click an object and then press Enter to see results.

Applying a little more constraint

If you’re using AutoCAD (not AutoCAD LT), you can constrain drawing objects geometrically by clicking buttons on the Geometric panel of the Parametric tab. In the following steps, I show you how to get started with geometric constraints.

These steps may seem tedious, but I want you to become familiar with the basic properties of each type of constraint. Later, I show you a couple of shortcuts that speed things up.

You can find the files I use in this sequence of steps at this book’s companion website: Go to www.dummies.com/go/autocadfd18 and download afd19.zip. The drawing named afd19c.dwg contains the unconstrained geometry, and drawing afd19d.dwg contains the end product.

Follow these steps to use geometric constraints:

  1. Start a new drawing. Make the Ribbon’s Parametric tab current, and turn off Snap, Ortho, Polar, Osnap, and Otrack on the status bar.

    For production drawings, you will want to make sure you use precision drafting aids, but in this example, you gain a better sense of parametrics with an extremely imprecise drawing.

  2. Draw some linework by using the PLine command, and then add a couple of circles.

    Draw it to look similar to Figure 19-2 if you want to follow these steps closely.

    Every drawing is tackled differently, so look ahead and figure out the most efficient way to apply the constraints you need in order to maintain your design intent. In this example, you end up with two concentric circles in the middle of a square.

    Tip As I mention earlier, applying constraints is easier if at least one point on the geometry is fixed in space. In many cases, consider applying the Fix constraint first — it constrains a point to a single location in the drawing area. This topic has nothing to do with tomcats.

    In this example, I show you how to lock one endpoint of the polyline into position.

  3. Screen capture depicting padlock icon. Click Fix in the Geometric panel, and then click a point that you want to fix in space.

    A blue padlock icon displays beside the pickbox, and the red pick point marker appears when you hover over a point that you can constrain (see Figure 19-3). In this example, I clicked an endpoint on the polyline. The padlock icon appears in the constraint bar, indicating that the endpoint of the polyline segment is fixed in place.

    With at least one point on the geometry fixed in place, you can start constraining the geometry by closing the gap in the linework.

  4. Screen capture depicting coincident icon. Click Coincident in the Parametric tab’s Geometric panel.

    You use a coincident constraint to make two points coincide. A blue coincident icon appears near the pickbox, and as you move the cursor over an object, a marker appears over relevant points. In the case of lines or polyline segments, they’re at the endpoints and the midpoint.

    Tip Use appropriate drawing commands based on your design intent. We use a polyline in this example because the ends of the segments are already coincident-constrained by being part of a single polyline object. If you had drawn this shape with lines, you’d have to apply individual coincident constraints to each corner.

  5. Click an endpoint on the first polyline segment that you want to connect, and then click an endpoint on the second segment.

    The endpoint of the second polyline segment jumps to the endpoint of the first line, and a small blue square (the marker for coincident constraints) appears at the intersection. If you don’t see the little blue square, click Show All in the Geometric panel.

  6. Screen capture depicting Horizontal icon. Apply some orthographic parameters so that the linework starts to look a little more like a rectangle. Click Horizontal in the Parametric tab’s Geometric panel, and then click a line or polyline segment that you want to align with the drawing’s X-axis.

    In this example, we picked the bottom segment of the polyline. The segment realigns horizontally from the endpoint nearest to the spot where you picked the line (unless a Fix constraint is added first), and a horizontal constraint marker (a constraint bar) appears near the object. A single item is still called the constraint bar because, if you add additional constraints to the object, they’re added to the existing one, like a toolbar.

  7. Screen capture depicting Vertical icon. Click Vertical to align a line or polyline segment with the drawing’s Y-axis.

    In this example, we pick the left vertical(-ish) polyline segment. The segment realigns at 90 degrees to the horizontal segment, and a constraint bar showing a vertical constraint appears. With one line segment horizontally constrained and another vertically constrained, you’re halfway to a geometrically precise rectangle.

  8. Screen capture depicting Parallel icon. Because rectangles have parallel and perpendicular sides, apply those constraints to your linework. Click Parallel in the Parametric tab’s Geometric panel, click the vertically constrained line segment, and then click the line segment opposite to it.

    Because a vertical constraint is already applied to one segment, it doesn’t matter which line you pick first. If neither line had an existing constraint, the second line you picked would become parallel to the first line.

    Remember Always prioritize your design intent as you consider which constraints to apply and when to apply them. As a general rule, start with the most important ones, and drill down to the least important. As I remind you earlier in this chapter, applying a fix constraint early in the game can prevent your geometry from rearranging itself in ways you don’t expect.

    To make the final side of the almost-rectangle orthogonal with the other three, you could use another parallel constraint and click the bottom line. However, you don’t want to wear out the Parallel button, so use Perpendicular on the final segment.

  9. Screen capture depicting Perpendicular icon. Click Perpendicular on the Geometric panel, click either vertical side, and then click the non-orthogonal side.

    Again, because three of the four sides are already constrained to horizontal and vertical, it doesn’t matter which segment you pick first.

    Remember Perpendicular means “at right angles to.” It isn’t restricted to “a vertical line extending upward from one end of a horizontal line.” A line at an angle to the X-axis can still be perpendicular to another, and the lines don’t have to touch.

    Tip Some constraints work on one object (horizontal, vertical), and others work on two objects (parallel, tangent, perpendicular). If you roll the cursor over a two-object constraint, its soul mate lights up.

    To delete a constraint, move the mouse pointer over the constraint marker to display the constraints bar (see Figure 19-4), right-click, and choose Delete from the menu that appears.

    From four non-orthogonal, not-even-closed line segments, applying a handful of constraints yields a perfect rectangle. However, you really want a square, which is where the Equal constraint comes in.

  10. Screen capture depicting Equal icon. Click Equal on the Geometric panel, click the bottom side, and then click either of the vertical sides.

    It’s a perfect square! Now you have to constrain those circles.

    The design intent in this example is to make the circles concentric and to locate their centers in the exact center of the rectangle. First, the easy part: Make the circles concentric.

  11. Screen capture depicting Concentric icon. Click Concentric in the Geometric panel, click one circle, and then click the other.

    The two circles are concentrically constrained. Try saying that ten times fast. A new constraint bar appears in their vicinity. Move one circle by clicking it, and watch the other tag along.

    As I suggest, concentric is the easy constraint. I’d love to be able to use the Mid Between 2 Points object snap and simply click two diagonally opposite corners to locate the circles dead center in the rectangle. However, because you can constrain only objects or points on objects, you have to add some construction geometry to maintain the design intent.

  12. Draw a line between diagonally opposite corners using Endpoint object snaps, and then apply coincident constraints between the endpoints of this line and the corners of the rectangle (see Figure 19-5).

    Tip Draw construction geometry on a separate layer, and set that layer to NoPlot in the Layer Properties Manager. If you don’t want to even see your construction geometry (or plot it), turn off the construction geometry layer, or freeze it. The geometric constraints will still work.

  13. Click Coincident in the Geometric panel. Click either circle so that the parametric marker appears in the center, move the pickbox over the construction line, and click when the parametric marker is over the midpoint of the line.

    You’re done! You can test your design intent by using the Stretch command on the corner of the rectangle that doesn’t display a square, blue coincident icon. As you drag the corner, you should see the two circles moving, too, always maintaining their position in the middle of the rectangle (see Figure 19-6).

Image described by caption and surrounding text.

FIGURE 19-2: Random shapes in need of constraining.

Image described by caption and surrounding text.

FIGURE 19-3: Locking down an object in drawing space.

Screen capture depicting a drawing with Perpendicular pop-up.

FIGURE 19-4: Constraining to orthogonal.

Screen capture depicting a drawing with Endpoint object snaps between the endpoints of a line and the corners of the rectangle.

FIGURE 19-5: Adding construction geometry.

Image described by caption and surrounding text.

FIGURE 19-6: Full-on geometric constraints.

Using inferred constraints

Screen capture depicting Infer Constraints icon. Parametrics were a new feature in AutoCAD 2010 and were considerably enhanced in AutoCAD 2011 by the addition of inferred constraints. A status bar button (to the left of the Snap button) toggles Infer Constraints mode off and on. When it’s on, you don’t have to specifically apply many of the geometric constraints.

To produce the best results, go at least partway back to drawing with precision. For example, a coincident constraint is applied pretty much any time you use an object snap, and horizontal and vertical constraints are placed if polar or ortho modes are on.

Tip Inferred constraints also work when editing existing geometry.

Inferred Constraints mode is a powerful component of parametric drafting in AutoCAD, but I recommend that you first familiarize yourself with manually applying constraints, as described in this chapter.

You AutoConstrain yourself!

The geometric constraints (refer to Table 19-1) are meant to be applied one at a time. That level of flexibility is helpful, but it can be pretty darned time-consuming to go around a complex object, trying to figure out what the best constraint option would be and then applying it.

Screen capture depicting Auto Constrain icon. The Auto Constrain button on the Parametric tab’s Geometric panel can apply a whack of constraints to a selection of objects with a single click. Before you execute that click, however, take a look at the Auto Constrain settings. Click the dialog box launcher (the little angled arrow at the right end of the Geometric panel label) to open the Constraint Settings dialog box and make the AutoConstrain tab active (see Figure 19-7). Choose the constraints you want to apply automatically, and their order in the list, so that the ones that should take precedence have a higher priority. Your best bet initially is to stick with the defaults until you become more familiar with how Auto Constrain works.

Image described by caption and surrounding text.

FIGURE 19-7: Auto-constrainable geometric relations in the Constraint Settings dialog box.

Remember Auto Constrain works only with geometric constraints, not with dimensional constraints.

AutoCAD doesn’t let you overconstrain an object. For example, if a horizontal constraint appears on one line, and a parallel constraint appears between it and a second line, AutoCAD objects if you try to add a horizontal constraint to the second line.

Understanding Dimensional Constraints

The normal practice in AutoCAD is to create some geometry using, of course, the precision techniques I discuss in Chapter 8 and then apply dimensions as I describe in Chapter 14. Assuming that you’re using fully associative dimensions, you can then edit the geometry and watch the dimensions update automatically. The length of the line or the radius of the circle is in control, and those dimensions are driven dimensions because they change when the object geometry changes.

Dimensional constraints, unlike regular AutoCAD dimensions, are driving dimensions — when you change the value of a dynamic dimension on a line, the line changes to match. In other words, the dimension is driving the length of the line, not the other way around.

There are only eight dimensional-constraint options, but they cover all the bases, as described in Table 19-2.

TABLE 19-2 Dimensional Constraints

Button

Constraint Name

What It Does

Image described by caption and surrounding text.

Linear

Applies a horizontal or vertical dimensional constraint (similar to DIMLINear)

Image described by caption and surrounding text.

Horizontal

Applies a dimensional constraint aligned with the X-axis of the coordinate system (similar to DIMLINear’s Horizontal option)

Image described by caption and surrounding text.

Vertical

Applies a dimensional constraint aligned with the Y-axis of the coordinate system (similar to DIMLINear’s Vertical option)

Image described by caption and surrounding text.

Aligned

Applies a dimensional constraint aligned with the object or with the points being dimensioned (similar to DIMALIgned)

Image described by caption and surrounding text.

Radial

Applies a set value or formula to the radius of an arc or a circle (similar to DIMRADius)

Image described by caption and surrounding text.

Diameter

Applies a set value or formula to the diameter of an arc or a circle (similar to DIMDIAMeter)

Image described by caption and surrounding text.

Angular

Applies a set value or formula to the angle between two lines or three points (similar to DIMANGular)

Image described by caption and surrounding text.

Convert

Converts an existing associative dimension object to a dimensional constraint

Practice a little constraint

The objects you add to a drawing from the Dimensional panel aren’t the same as the dimension objects you add from the Annotate tab. Dimensional constraints are driving dimensions — when you change the value of one of these dimensions, the geometry changes.

Tip A lot is happening behind the scenes as you apply parametric constraints. You can get a sense of how these constraints work at keeping drawing objects in order by using the Stretch command on objects after you apply a constraint to them.

You can find the files I use in these steps at this book’s companion website: Go to www.dummies.com/go/autocadfd18 and download afd19.zip. The drawing named afd19a.dwg contains the unconstrained geometry, and the drawing named afd19b.dwg contains the end product.

These steps present a simple example of dimensional constraints:

  1. Start a new drawing and make the Ribbon’s Parametric tab current.
  2. Turn on the appropriate precision drawing aids on the status bar, such as Snap, Ortho, and Osnap.
  3. Draw some reasonably precise geometry by applying the precision techniques I describe in earlier chapters.

    In the following example, I use the RECtang and Circle commands to draw the geometry you see in Figure 19-8. The rectangle is ten units square, and the 2.5-unit-radius circle is deliberately drawn away from the middle of the square.

  4. Screen capture depicting Linear split icon. On the Dimensional panel of the Parametric tab, click the top part of the Linear split button.

    A linear dimension icon appears beside the pickbox, and AutoCAD prompts you to either specify the first constraint point or pick an object.

    Like the DimLInear command, the Linear dimensional constraint tool is inferential — which way you drag the cursor controls whether you create a horizontal or vertical dimension. Also, as with DimLInear, you can press Enter at the command line and select an object to dimension.

    Tip Hover the mouse over the Linear button to see (unlike its neighbor, Aligned) that the button is split into two parts. To force a linear dimensional constraint to be either horizontal or vertical (rather than dependent on the direction you drag the cursor), click the bottom part of the Linear button and choose from the drop-down menu.

  5. Press Enter at the command line to confirm that you want to select an object, and then select the bottom horizontal line segment.

    Remember If you see red markers at the midpoint and endpoints of the bottom line, you didn’t press Enter — and AutoCAD is in Point Selection mode rather than Object Selection mode.

    AutoCAD generates a preview of a dimensional constraint and prompts you for a location.

  6. Click to locate the dimension position.

    AutoCAD draws a dimensional constraint with a highlighted text field displaying the dimension name (d1, in this example) and the value returned by AutoCAD.

  7. Press Enter to confirm the value and the dimension location (see Figure 19-9).

    Tip Best practice is usually to accept the default value for all dimensional constraints as they are applied and then edit them later to the exact values that are desired. This avoids problems such trying to make the width of a slot greater than the width of the piece that contains the slot, which can turn your drawing inside out.

    Tip If the dimensional constraints disappear as soon as you place them, click the Show All button on the Parametric tab’s Dimensional panel (refer to Figure 19-1).

    Remember Because dimensional constraints aren’t regular dimension objects, you can’t plot them, so it doesn’t matter where you put them or what they look like. I show you in the next section how to turn dimensional constraints into properly styled, plotable dimensions.

  8. Repeat Steps 4–6 and add a dimensional constraint to the rightmost vertical edge of the rectangle.

    AutoCAD draws a second dimensional constraint, this one named d2.

Image described by caption and surrounding text.

FIGURE 19-8: Simple geometry, badly in need of constraining.

Image described by caption and surrounding text.

FIGURE 19-9: Placing a dimensional constraint.

Making your drawing even smarter

If your drawing were a traditional mechanical drawing that followed the rules of drafting, the placement of a horizontal and vertical dimension in the example of the previous section would be enough. Whoever reads your drawing understands that if sides are parallel and perpendicular, a dimension on one side applies to the opposite side as well. But in this chapter, I talk about intelligent drawings that respect design intent — not dumb collections of lines and circles, even if they do follow the rules of drafting.

If you stretch a rectangle in various ways (from the upper-left corner, for example), you can see that only the bottom and right sides are constrained to 10 units in length. You can add two more linear dimensional constraints to the unconstrained sides, but then you’d have to remember to edit both dimensions. Rather than constrain both sides to be 10 units long, you maintain design intent by making both sides equal in length.

Tip You can make the two sides equal by using either dimensional or geometric constraints. You should usually apply most, or all, of the geometric constraints to the drawing before adding dimensional constraints. This way, the objects behave in a more predictable manner when you change the dimension values.

Follow these steps to apply three geometric constraints:

  1. Screen capture depicting padlock icon. On the Geometric panel of the Parametric tab, click Fix (the padlock icon) and then click the lower-left corner of the rectangle.
  2. Image described by caption and surrounding text. Image described by caption and surrounding text. On the Geometric panel, click Horizontal and click the bottom side of the rectangle. Then click Vertical and click the left side.

    Icons appear near the drawing geometry, showing that those three geometric constraints are active.

  3. On the Dimensional panel of the Parametric tab, click Linear and add a dimensional constraint to the top horizontal line.
  4. Click to locate the dimension, type d1, and then press Enter when AutoCAD prompts you for the dimension text.

    Rather than display numeric values, like the first two linear constraints, this new dimensional constraint displays fx: d3=d1.

    Technical stuff The main part of this expression sets the d3 dimension to equal the value of the d1 dimension. The fx: reminds you that other variables in other dimensions are being referenced.

  5. Repeat Steps 3 and 4, and this time add a constraint to the vertical line at the left. Then enter d2 as the dimension text.

    All four dynamic dimensional constraints display their names and a value or expression for each one.

Dimensional constraints have names as well as values. They can also include expressions or formulas. You can set the default appearance of dynamic dimensional constraints by clicking the dialog box launcher (the little arrow at the right end of the Dimensional panel label) to open the Constraint Settings dialog box, with the Dimensional tab active (see Figure 19-10).

Image described by caption and surrounding text.

FIGURE 19-10: Format the appearance of dimensional constraints in the Constraint Settings dialog box.

The options are as follows:

  • Name: The first linear dimension is named d1, the second d2, and so on. You use the dimension names in expressions.
  • Value: The numeric value that you enter into the dimensional constraint (or that AutoCAD enters if you don’t override it).
  • Name and Expression: The dimension name shown as equal to an expression. The expression can be a value, as in this example, or it can be a formula that includes other dimension names.

Using the Parameters Manager

Both AutoCAD and AutoCAD LT include the Parameters Manager palette, accessible from the Manage panels of the Ribbon’s Parametric tab. You can use the Parameters Manager to give all those dimensional constraints more sensible names than d1 and d2, but you can (even more usefully) enter expressions instead of plain numeric values, as I explain in these steps:

  1. Screen capture depicting Parameters icon. Click Parameters Manager in the Manage panel.

    The Parameters Manager palette appears, showing a list of the dimensional constraints applied in the drawing (see Figure 19-11).

    In Figure 19-11, the Expression column shows the numeric values that I specified for d1 and d2 and the expressions I entered for d3 and d4. The read-only Value column shows the calculated value. You can’t change a value in the Value column (it’s grayed out to remind you). You can only edit the cells in the Expression column.

  2. In the d1 row, click in the Expression field to highlight the current value (10, in this example). Then click again and type a new value. For example, type 13 and press Enter.

    The rectangle resizes in the drawing editor, and because the d3 constraint on the top side was made equal to the d1 constraint on the bottom side, both sides change equally.

    Next, you use an equation as an expression.

  3. In the d2 row, click in the Expression field to highlight the current value, and then type an expression. For example, type d1*0.75 and then press Enter.

    The read-only Value column and the drawing geometry show that the new d1 distance of 13 has been multiplied by 0.75 and is now 9.75 (see Figure 19-12).

  4. Close the Parameters Manager.

    Constrain the circle so that its center is always at dead center in the rectangle, no matter how the rectangle’s size changes.

  5. Apply a horizontal dimensional constraint from the upper-left corner of the rectangle to the center of the circle. Locate the dimension, type d3/2, and then press Enter.

    Because the rectangle is now dimensionally constrained on all four sides, it doesn’t matter which corner you start from. Note that you don’t have to type the whole expression: d5=d3/2. AutoCAD knows what you mean!

  6. Repeat Step 5, and this time add a vertical constraint from one corner to the center of the circle. Locate the dimension, and then type d4/2.

    Figure 19-13 shows the object geometry with all constraints added in this section. Who knew that drafting could be such fun?

Image described by caption and surrounding text.

FIGURE 19-11: The Parameters Manager palette.

Image described by caption and surrounding text.

FIGURE 19-12: Editing constraints in the Parameters Manager.

Image described by caption and surrounding text.

FIGURE 19-13: All locked down — dimensionally, at least.

If your drawing becomes overrun with parameters, you can add parameter filters in the Parameters Manager palette. Right-click any parameter and choose Show Filter Tree, or click the double right arrow at the top left of the palette to open the Filters pane. Click the funnel icon on the toolbar to create a new filter group, and then simply drag and drop parameters into the group. Figure 19-14 shows the two constraints (refer to Steps 5 and 6 of the preceding step list) dragged into a new group filter.

Image described by caption and surrounding text.

FIGURE 19-14: Filter parameters to keep them organized.

Dimensions or constraints? Have it both ways!

After all the hard work of adding dimensional constraints to a drawing, it would be a downright shame to have to go back and apply regular dimensions, wouldn’t it? Well, you don’t have to. You can make dimensional constraints look and behave like regular dimensions. You can go the other way, too, and make your regular dimensions act like dimensional constraints.

Dimensional constraints are available in two flavors:

  • Dynamic: In this default form, a dynamic constraint is gray, with a padlock icon next to it in the drawing area. You can make the constraint appear and disappear by clicking Show All in the Dimensional panel. Dynamic constraints don’t plot, and they’re always legible because they resize as you zoom in and out of the drawing.
  • Annotational: This form is controlled as an object property, so you have to set it in the Properties palette. Though annotational constraints plot, they don’t resize as you zoom in and out, and they don’t disappear as you toggle the Show All button on and off. Annotational constraints conform to dimension style settings.

Remember The dimension name format of annotational constraints can be set to Name, Value, or Name and Expression, just like dynamic constraints. Refer to Figure 19-10 for another look at the Constraint Settings dialog box. If you want to plot a drawing with annotational constraints, reset the format so that it doesn’t show the dimension name or the expression.

Here’s how to turn dynamic dimensional constraints into annotational constraints:

  1. Open a drawing that contains some geometry with dimensional constraints.

    You can also start a new drawing, draw some simple geometry, and add a dimensional constraint or two.

  2. Select a dynamic constraint, right-click, and choose Properties.

    The Properties palette opens with the object properties of the selected dimensional constraint listed in table form.

  3. Click in the Constraint Form field, and in the drop-down list, change Dynamic to Annotational (see Figure 19-15).

    The dynamic constraint becomes annotational and takes on the appearance of the current dimension style. If you change the dimension style in the Properties palette, the annotational constraint updates to the new dimension style format.

    You can go the other way, too — from regular dimension objects to dimensional constraints to convert an existing dumb drawing to an intelligent parametric one.

  4. Add a linear, radius, diameter, aligned, or angular dimension (that is, a regular dimension, not a dimensional parameter) to your drawing geometry.

    Nearly every type of dimension object has a parametric analog; the exceptions are arc length, jogged radius, jogged linear, and ordinate dimensions.

  5. Screen capture depicting Convert icon. Click Convert in the Dimensional panel, select a dimension type (refer to Step 4), and press Enter.

    The Dimensional Constraint text box displays as soon as you click an associative dimension, and the dimension becomes a dynamic constraint as soon as you press Enter.

Image described by caption and surrounding text.

FIGURE 19-15: Turning dynamic constraints into annotational ones.

Remember The only clue that a dimension is an annotational constraint rather than a regular associative dimension is the padlock icon that appears next to the dimension value. You can turn off the display of the padlock from the Constraint Settings dialog box, but I recommend that you leave it on. It doesn’t plot anyway, and you might decide to delete the dimension without realizing that it’s controlling your object geometry.

Annotational dimensions can also be annotative so that they size themselves automatically to the drawing scale. I cover annotative dimensions in Chapter 14. Annotative and annotational dimensions are also associative, so you can have annotative annotational associative dimensions. Try saying that quickly after a few drinks.

Remember In this chapter, I present the two varieties of parametric constraints separately, but you get the most mileage from this feature when you incorporate both geometric and dimensional constraints with other precision techniques (described in Chapter 8). In fact, if you start a drawing by using Snap, Ortho, Osnap, and other precision techniques before you add dimensional and parametric constraints, you’ll be well on your way to creating a library of intelligent drawings that maintain your design intent.

Tip Geometric and dimensional constraints can be equivalent. For example, a 90-degree-angle dimensional constraint is equal to a perpendicular geometric constraint, and AutoCAD doesn’t let you apply both.

All examples in this chapter involve a single drawing view. Geometric constraints apply “to infinity,” so you can synchronize objects from one orthographic view with objects in another. For example, coincident and collinear constraints can link objects in the front view with their equivalents in the top and right-side views, and liberal use of the equal constraint means that you should never have to measure or dimension anything twice, you should never need more than minimal construction geometry, any changes in one view reflect through to the others, and your views always remain orthogonally aligned.

Lunchtime!

You may recall that in the opening paragraphs I laid out a scenario wherein your boss instructed you to make a number of changes, and I implied that you could do them almost instantaneously. If you haven’t already done so, go to www.dummies.com/go/autocadfd18 and download afd19.zip. Open the drawing named afd19e.dwg, which looks like Figure 19-16.

Image described by caption and surrounding text.

FIGURE 19-16: This part needs a few revisions.

Now double-click the dia=1.5000 dimension and change it to dia1=2.0000 and then press Enter. Surprise! Two more dimensions change and all three views update! While you're at it, change ang1=30 to ang1=60, change d5=2.5000 to d5=2.000, change d6=3.0000 to d6=2.5000, and change d1=10.000 to 8.1250. Then print your drawing and head to the door to meet your boss and the client with a drawing that looks like Figure 19-17.

Image described by caption and surrounding text.

FIGURE 19-17: Thirty seconds later …

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.174.76