Showing results for 
Search instead for 
Did you mean: 
Showing results for 
Search instead for 
Did you mean: 

The PTC Community email address has changed to Learn more.

Create CAD Geometry in PTC Mathcad? Here's How


Create CAD Geometry in PTC Mathcad? Here's How

Written by David Martin for PTC


You might be aware that you can drive a Creo Parametric model from a PTC Mathcad worksheet. There are actually two ways to do this:

  • You can embed a PTC Mathcad worksheet directly in a CAD model.
  • You can create a Prime Analysis feature.

Both methods allow you to send values of dimensions and parameters from Creo Parametric to PTC Mathcad, perform calculations, and then receive dimensions back. These values can then be assigned to feature dimensions via relations, so that your engineering calculations drive your model geometry.


However, did you know that you can create CAD geometry directly in PTC Mathcad? Custom functions available to everyone from the PTC Community can be used to generate 2D curves using the IBL file format, and 3D surfaces using both DXF and STL file formats. In this post, we’ll look at the 3D methods.


STL Files

The STL file format is an abbreviation of Stereolithography, and is commonly used in additive manufacturing, commonly known as 3D printing. Therefore, if you have access to a 3D printer, you can generate a real-world 3D part from PTC Mathcad! The Write STL function is available from this link:


The article includes two PTC Mathcad worksheets showing 2 different matrix styles possible to generate 3D models. “WriteSTL takes an array of triangle vertices. The included PTC Mathcad worksheets demonstrate inline routines to convert each matrix type to triangle vertices arrays,” writes the PTC support source.


DXF Files

The Drawing Exchange Format, or DXF, was created by Autodesk in 1982 to help share files between AutoCAD and other programs. In Creo Parametric, it tends to be used more for sharing 2D production drawings from other CAD packages. (In the past, I’ve used DXF to create drawing formats in Creo Parametric from legacy data when companies have switched over from another system.) But DXF can be used to generate 3D surfaces as well. The Write DXF function is available from this link:


Practical Example

One day while perusing the PTC Community, I saw a post in which someone asked how to create a hyperbolic paraboloid in Creo Parametric. That shape can basically be described as a saddle, and is defined by a straightforward equation. You can find more information about it in this Wikipedia article.


I didn’t have an answer for the end user, but the question always stuck in the back of my mind. You can’t create a surface from an equation. Maybe you could create the boundary curves and a couple internal curves, and then generate a parametric or “technical” surface using the Boundary Blend function in standard mode, or a freeform surface in ISDX.


After I came across the worksheets page in the PTC Community, I decided to give it a try. I modified the equations and write statements to fit the vector equation of a hyperbolic paraboloid. This generated STL and DXF files, which I was able to import into Creo Parametric.

You can see the final result here:geometry-from-mc.png


Pretty cool.


PTC Mathcad and Product Design

To see how you can further integrate PTC Mathcad into your design processes, view the prerecorded webcast, Engineering Calculations: A Prime Concern, with PTC Product Manager Andrew McGough. In just 20 minutes, you’ll see how you can use PTC Mathcad to solve calculations and send the results to Creo, document your data, and much more.webcast-banner.png

Top Tags