Drive SolidWorks Models with Your PTC Mathcad Calculations




Many dimensions and parameters within a given CAD model are derived from mathematical equations, formulas, optimizations, routines, etc. Yet surprisingly, the connection between the two is often broken or unclear.

If you use Creo, you have the luxury of a tight, seamless integration between Creo 3.0 and PTC Mathcad Prime 3.1. For SolidWorks users, we have a custom integration which allows for up to six values to be passed from PTC Mathcad to SolidWorks (or vice versa). So PTC Mathcad outputs can be used to drive values in the SolidWorks design table or SolidWorks design table values may be used to drive PTC Mathcad inputs. But what if you are looking to push 10 or 100 (or perhaps even more than that) values quickly from PTC  Mathcad to SolidWorks? 

Driving SolidWorks with more than six values

The out-of-the-box integration is not your best option. In that case, you would do better to source your design table from an Excel file (and maintain the link to the file), and have Mathcad write all your outputs into an Excel file.

Let’s say for example we are designing a helical compression spring. We want to design the spring around 3 inputs—the min deflection, allowable shear stress, and  axial load applied to the spring. We can set up a solve block, parameterize it, and call the function for a set of 6 input conditions as follows:

Parameterize the solve block by setting the left side of the minimize function to a function with the inputs to the system as in the image below:

Then, set up three input arrays for the different scenarios you want to optimize for:

Call the function and visualize the outputs:

Augment all the outputs into a matrix, and write it to Excel:

Once you have created the Excel file, you can point SolidWorks to it. Be sure to maintain the link to the file in case PTC Mathcad calculations update the intermittent Excel file:

After clicking the green check mark, the design table will populate with the latest and greatest Mathcad optimization for each of the scenarios:

And upon exiting the design table view, SolidWorks will let you know the system has added six new configurations to the design table:

With these simple steps, you can easily run iterative calculations in Mathcad and push the results into your SolidWorks design table. Push 6 configurations with 4 variables per configuration or push 25 configurations with 10 variables per configuration. The number does not matter. What does matter is the fact that the source of your CAD calculations is directly driving the CAD parameters.