Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
autocad_2013_for_dummies.pdf
Скачиваний:
24
Добавлен:
19.02.2016
Размер:
24.71 Mб
Скачать

Chapter 19: Call the Parametrics! 439

Figure 19-9: Placing a dimensional constraint.

Making your drawing even smarter

If this were a traditional mechanical drawing that followed the rules of drafting, those two dimensions would be enough: Whoever is reading 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, we’re talking 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 try stretching the 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 could add two more linear dimensional constraints to the unconstrained sides, but then you’d have to remember to edit both dimensions. Rather than constraining both sides to be 10 units long, the way to maintain design intent is to make both sides equal in length.

www.it-ebooks.info

440 Part IV: Advancing with AutoCAD

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

We cover geometric constraints in the “Understanding Geometric Constraints” section, earlier in the chapter, so if you read that section, you should understand why we’re going to apply three geometric constraints.

1.On the Geometric panel of the Parametric tab, click Fix (the padlock icon) and then click the lower-left corner of the rectangle.

2.On the Geometric panel, click Horizontal and then 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 for the dimension text.

Instead of having numeric values like the first two linear constraints, this new dimensional constraint displays fx: d3=d1.

The main part of this expression sets the d3 dimension to equal the value of the d1 dimension. The fx: is there just to remind you that other variables in other dimensions are being referenced.

5.Repeat Steps 3 and 4, this time adding a constraint to the vertical line at the left and then entering d2 as the dimension text.

All four dynamic dimensional constraints display their names, plus a value or expression for each.

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). The options are

Name: The first linear dimension is named d1, the second d2, and so forth. 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.

www.it-ebooks.info

Chapter 19: Call the Parametrics! 441

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.

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

Using the Parameters Manager

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

1.Click Parameters Manager in the Manage panel.

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

In Figure 19-11, the Expression column shows the numeric values we specified for d1 and d2 and the expressions we 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.

www.it-ebooks.info

442 Part IV: Advancing with AutoCAD

Figure 19-11: The Parameters Manager palette.

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 itself 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, 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.

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

www.it-ebooks.info

Chapter 19: Call the Parametrics! 443

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

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 really matter which corner you start from. And note that you don’t have to type the whole expression d5=d3/2. AutoCAD knows what you mean!

6.Repeat Step 5, this time adding a vertical constraint from one of the

corners 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?

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

If your drawing starts getting overwhelmed 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

www.it-ebooks.info

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]