CAD Automation: Parametric Modeling and Custom CAD Tools

Computer Aided Design has been evolving over the past years. Read on about how parametric modeling and custom CAD Tools have helped shape this industry.

Sunny K. Tuladhar
8 min readAug 10, 2020
Source: favpng.com by lanzilloduk6

Computer Aided Design(CAD) is now the back bone of mechanical part design. A tool used so extensively that we tend to forget that all a CAD software is a computer program, which runs on code. And just like all other things that run on code, this can be automated. And the main purpose of automation is to save time and be more efficient. There are many hyperlinks(Underlined text) throughout the article and I encourage you to check all of them out while reading this.

More on CAD and Automation in this article of mine: https://tinyurl.com/wtq4ndv

Here we will talk about Custom CAD Tools and Parametric Modeling and how they help to save time and make a CAD user more efficient. We will mainly be talking about CAD through the perspective of a Mechanical Engineer but the core concept can be generalized into other fields where it is used. The software I will be giving examples are of SolidWorks and Onshape but the same features are available in most other B-rep CAD software (e.g. Creo Parametric,CATIA, Fusion 360, Siemens NX etc.)(We will discuss what B-rep is in another article). Also, I hear FreeCAD(written in python)is an awesome example of customization as the entire software is open-source but for the time being the software is a little difficult to use for me. But it hasn’t even reached a version 1.0(as of this article being written) so I guess better things are in store.

Common B-rep CAD software (that I have used) which can be automated

Parametric Modeling

Parametric modeling is modeling done is such a way that the dimensions of a part are dependent on a few parameters. All the dimensions are assigned in manner that it changes according to the requirement of the model and the design. This is achieved by assigning some main parameters and then giving dimensions based on a relation to these parameters. This allows for small changes and adjustments to be made in the model very fast and accurately.

Here’s a small example of a parametric model made in SolidWorks. The cuboid shown below has three dimensions. “Width(Main)”, “height” and “T”. “Width(Main)” is its main parameter. The “height” and “T” are dependent on “Width(Main)” based on an equation(relation). The relation is shown below(dimensions in mm)

Height = Width(main) — 20

T= Width(main) — 50

So to change the entire model you only need to change the “Width(Main)” dimension. Below you can see the examples with “Width(Main)” = 60 which changes the height = 60–20 = 40, T =60–50 =10. Similarly for “Width(Main)” = 100 : height = 100–20 = 80, T =100–50 =50

Simple cuboid with “Width(MAIN)” dimension = 60. The rest of the dimensions are defined by the Width.
Simple cuboid with “Width(MAIN)” dimension = 100. The rest of the dimensions are defined by the Width

Here’s another example using legos. The main parameter of this model is marked in red box (NUMBER OF POSTS). Which is the number of posts on the topside i.e. 4. When its value is changed the whole model adjusts accordingly.

Shown below is the same model with the value of “NUMBER OF POSTS” (N) changed to 4 and 6. The length and the number of inner posts adjust accordingly.

The value of length (blue) and Inner posts(Red arrow) changes if we change the value of ’N’. They are all dependent on the value of ‘N’.

The tutorial for this Parametric Lego model in Solidworks can be found here. It is also a simple and great example of ‘Configurations’ in the software.

A well made parametric model can be turned into tool in of itself. (By well-made I mean being able to handle exceptions well. For example negative values have to give an error). Below is an example of such a tool. It is the Spur Gear Tool from Onshape. It creates a spur gear of the required size based only the dimensions of the required parameters you give it. You can also view the FeatureScript code used in it. Featurescript is a coding language made by Onshape for building and working with 3D parametric models. All of its standard tools like “Extrude” are written in this.

Instructions on how to use the Spur Gear tool in Onshape. It is a public tool and can be accessed by anyone with an Onshape account.

Below are two spur gears made from the above tool. It literally takes only a few seconds to create and modify them. But the limitation is that you can only modify as much as the tool allows you to. Extra modifications can be made manually.

Two different gears created within seconds using the Onshape Spur Gear tool
Required parameters for a spur gear

The dialog box on the left show all the parameters that need to be defined to create a spur gear model. This also includes whether or not there needs to be a key way or even a center bore. The rest of the dimensions are adjusted based on relations to these parameters. While this tool is quite flexible if more modifications are required in the part we will have to do them manually.

Also, this tool can only create Spur gears. If,for example,you need to make a Bevel gear you will need another tool and if that is not available it can be a problem. Hence, for now knowing how to operate a CAD software helps. But slowly as new tools develop it will make our modeling lives easier.

Custom CAD Tools

All software have their own built in standard tools — the ones which were made by the developers with the intention that it will be generally applicable to as many types of common jobs as possible. The tools such as “Extrude” and “Extrude Cut” are as general as it gets.

The extrude tool (named differently in other CAD) in SolidWorks which extrudes a 2D drawing into a 3D object. The most basic of CAD tools.

Custom CAD Tools, as opposed to the built in tools , are the ones that are suitable for a specific task for a company or a type of company. Its main aim is to be able to perform repetitive tasks (which are very specific) with very few manual inputs. These are usually created by the users themselves.

The tool shown below was made in OnShape. It was coded using Featurescript code which is native to Onshape. This “Wave Spring” tool is available in its library for public use.

2 variations created using an Onshape tool to create a Wave Spring. All you have to do is enter the dimensions shown in the top left box.

The above example is a Custom CAD Tool for a wave spring(Also an example of Parametric Modeling similar to the above ‘Spur Gear Tool’). This tool can create a wave spring ,just by entering dimensions in the top left box ,in less than a minute. Imagine you work in a company in which you have to deal with a lot of leaf springs in a assembly. If this had to modeled from scratch it would take an average CAD user around 30 minutes. If it is made by reusing models(changing dimensions) then still it could take around 7 minutes (for an average user) to make the spring. This is a significant amount of time compared to the custom tool’s less-than-a-minute time.

When this task is done repeatedly and by a number of workers the time saved by this tool reaches in the thousands of hours. This leaves more time for more “human” tasks like brainstorming, problem solving and design.

Below is another example of a custom CAD tool in Solidworks; made by Shashank Dewan from Pro-Mech minds, which properly arranges random dimensions in the drawing and also takes the datum(origin) at the center. This is a very specific requirement which might not be useful for all users but for the right user this saves a LOT of time while creating official 2D drawings. This tool was custom made using C# and the Solidworks API.

Auto-Dimension arranging tool with the center of the part as origin. Creator: Sashank Dewan

Application

While the above tools have obvious applications in the industry there is one in particular that I found useful to discuss. The parametric modeling tools are used to create standard part 3D model generators in a company’s website.

The image shown below is from the website of the company IAI. The Panel on the right is where you input the parameters, on the right you can view the generated 3D model. All this happens in the browser, no CAD software required. The generated model can then be downloaded in the required formats. The shown image is of a Cylinder (Robot Cylinder).

A CAD model generator of the company “IAI” for a Cylinder (Robot Cylinder) with Slider Type >RCP5 series >Motor Reversing Type. Source : IAI Part Community

Advantages

A great advantage of the above tools is that it requires less skill to operate. Even a person with rudimentary CAD skills but sound engineering knowledge will be able to create that wave spring or a spur gear in a less than a minute. Hence, it really helps skilled engineers but beginner CAD users to create 3D models without having to learn the software in much detail.

The above tools also help to save time. Using the above shown “Dimension Organizer” tool saves a lot of time in arranging the dimensions to get a cleaner look. As the drawing gets more complex, this tool will save more time.

Taking the example of a spur gear tool. To create the spur gear an average CAD user will take around 45 minutes. Using a template it will take around 10 minutes. Using the tool it would take 1 minute. That time saved is staggering. As mentioned already, more time for human centered tasks.

The models made from a well-defined tool are also very accurate as it reduces the human element from the model. The chances of the dimensions being mistaken using the “Spur Gear Tool” are very low and thus this also improves the efficiency of the work.

Conclusion

In conclusion CAD has the ability to be automated by the use of parametric models and custom tools. The first one can be done directly in the CAD software while the to create the custom tool a certain level of programming skill is required along with CAD skills. These two combined help to create a less mundane and efficient work environment for users of CAD. Parametric modeling can also be used in company websites to display their products in various dimensions. Hence, this is an aspect of computer aided design the current generation of engineering students should definitely explore.

--

--

Sunny K. Tuladhar

AI Engineer✨, Musician🎸, Mechanical Engineer⚙️ ML/AI, Data, CAD, Music, Movies, videogames