200 AutoCAD Commands and Shortcuts PDF eBook

Download the free eBook containing fully categorized list of 200+ AutoCAD commands, shortcuts, function keys and more

An introduction to Parametric Drawing, Constraints and Formulas in AutoCAD

Last Updated: January 30th, 2022By Categories: AutoCAD

The parametric drawing is a method of making geometries with geometrical or dimensional constraints or restrictions. These constraints are applied to the geometry with respect to certain references or other geometries. Parametric drawings update itself if any one parameter is changed, this also helps in maintaining design intent.

This feature of parametric drawing was introducedย in 2010 version of AutoCAD. This article explains the concepts ofย Parametric Drawing, Constraints and Formulas in AutoCAD. Let’s start with applying constraints in the drawing with the help of aย simple drawing.

Applying Constraints:

Make a rectangle with any dimensions and a circle at the geometric center of the rectangle. Now go to the Parametric tab and select the linear option from the Dimensional panel. Click at the top left vertex of the rectangle and then click at the top right vertex and place the linear constraint. Similarly, apply the linear constraint on any one vertical side of the rectangle.

5

Linear constraint on Dimensional panel

The dimensional constraint is different from the simple dimensioning and should not be confused with that. Select Diameter constraint from Dimensional panel and apply it to the circle at the geometric center of the rectangle.ย Now apply the linear constraint to the circle with respect to the horizontal and verticle side of the rectangle.

Now select Fix constraint from the Geometric panel and click at two diagonally opposite vertices of the rectangle to make it fixed. Now select Perpendicular constraint and apply it on three vertices of the rectangle. The geometry is now fully constrained as shown in theย image below.

Making simple formulas:

Let’s assume that we want the geometry made above to behave in such a way that diameter of the circle always remains half of length of the rectangle. For that, we can create a simple relation or formula and apply it to the respective geometries in the drawing.

Click on Parameters Manager icon on Manage panel of Parameters tab or use its command equivalent PARAMETERS. Click on theย 2016-09-05_19-41-46ย icon on Parameters Manager palette, a new list User Parameters will be added to theย palette.

Parametric Drawing, Constraints and Formulas in AutoCAD

Parameters manager palette

Double click on the user1 parameter and change its name to DIA. Double click again on expression column next to DIA and type d1/2 which mean DIA parameter will be equal to d1/2 where d1 is theย length of the Rectangle.

You can now use this formula to define theย diameter of theย circle, double click on Expression column of dia1 row in parameters manager palette and change it to DIA as shown in theย image above, the circle will update according to changed dimension and diameter of circle will become equal to value of DIA which is half of length of rectangle.

To test this formula go to d1 in drawing area and change its value, you will notice that diameter of the circle will also change accordingly not only in parameters manager palette but also in the drawing area.

Making nested formulas:

In the above example, I have used a simple formula but you can also use nested and complex formulas that involve the use of sine, cosine and logarithmic expressions. I will use the same example of rectangle and circle to explain thisย as well.

Suppose we want to change the length of the rectangle (d1) in such a way that it always remains five units less than twice of theย width of the Rectangle (d2) then we can use this expressionย (d2*2)-5ย to define theย length of theย rectangle where d2 is the width of the Rectangle.

To apply this formula click on theย ย icon and double click on user2 and rename it to EXP. Again double click on the expression box next to EXP and write the expression (d2*2)-5.

Now write EXP in d1 row expression column as shown in theย image below. You will notice that length of rectangle changes to reflect dimension according to formula. Final settings in parameters manager will look like this.

Parametric Drawing, Constraints and Formulas in AutoCAD

The final parameters in Parameters manager palette

You can test this nested expression by changing theย value of d2 which will change dimensions of all dependent geometries including the diameter of the circle.

Do you have questions related to this tip? Let me know in comments below.

200 AutoCAD Commands and Shortcuts PDF eBook

Download the free eBook containing fully categorized list of 200+ AutoCAD commands, shortcuts, function keys and more

13 Comments

  1. Maycol January 8, 2022 at 1:31 am - Reply

    thanks for share your knolegmend, nowadays I as well do program at visual Lisp and thing is amazing

  2. Eddy Lo September 14, 2021 at 4:51 am - Reply

    Can I add cos angle

  3. Dean M. November 5, 2020 at 12:29 am - Reply

    Hi!!

    Just some feedback for the changing market conditions in 2020 and going forward.

    Considering the expanding market and available offerings in online CAD learning from such entities as Udemy and many others, your current pricing structure seems to be non-competitive. Revising the pricing structure could widen the reach of your services, and thus increase your overall revenue. Also, are you using social media optimally to reach more potential clients?

    Some food for thought…

  4. Carlos Eduardo de Oliveira May 24, 2020 at 11:10 pm - Reply

    Thanks a lot for sharing some of your skills and experience.

  5. Ojobor April 6, 2020 at 7:18 am - Reply

    You have try a lot sir

  6. Bob Barbara October 21, 2019 at 6:20 am - Reply

    This example is not working with Autocad 2017. When trying to apply the perpendicular constraint to 3 vertices the system would not allow me to do more than 2 vertices. Got the message “The constraint cannot be applied”. I’ve tried doing the tutorial 3 times with the same result.

  7. GRoach October 3, 2018 at 8:40 pm - Reply

    When I write the expression (d2*2)-5, I get an error box,saying “A dependent expression cannot be evaluated”

  8. steve September 20, 2016 at 11:14 pm - Reply

    !Estupendo, amigo! Gracias!

    • Jaiprakash Pandey September 21, 2016 at 12:19 pm - Reply

      Thanks Steve :)

  9. Seshachalam Chamarthy May 15, 2016 at 10:23 am - Reply

    Nice explanation with screenshots. Thank you very much

    • Jaiprakash Pandey May 15, 2016 at 4:42 pm - Reply

      Welcome

  10. N.Ramaswamy April 15, 2015 at 8:03 am - Reply

    Dear Mr. Pandey,

    Your explanations are really out of the world and any layman can follow the instructions without any difficulty. FANTASTIC WORK INDEED.
    WISH YOU ALL THE BEST FOR MANY MORE SUCH LESSONS
    RAMASWAMY

    • Jaiprakash Pandey April 15, 2015 at 1:57 pm - Reply

      Thanks N.Ramaswamy :)

Leave A Comment