Spreadsheets and Creo: Two Must-Know PTC Mathcad Integrations

Written by: Dave Martin
12/16/2019

Read Time: 5 min.

In a previous article, we compared traditional spreadsheets to PTC Mathcad. We showed that for engineering calculations, a tool designed to support variables, functions, programs, and real-math notation makes a better choice for product development than a tool used for accounting.

PTC Mathcad possesses two additional capabilities you should know about for extending the power of your engineering calculations. First, you can leverage Microsoft Excel spreadsheets in PTC Mathcad. Second, PTC Mathcad worksheets can be used by your Creo Parametric models to drive your product designs.

Using PTC Mathcad with Excel

PTC Mathcad and Microsoft Excel are not mutually exclusive for product development; you can use both. You might have legacy spreadsheets with historical data, or you might have data stored in Excel, text, or comma-separated value (CSV) formats that you want to use.
For example, I’ve had Excel files for power spectral density functions for dynamic analyses, strain gauge data from structural testing, and airfoil (wing) profiles. Ideally, I would want to recreate them in PTC Mathcad, but that’s not always feasible or possible. Fortunately, I can leverage the existing spreadsheets and integrate them into my PTC Mathcad worksheets.

PTC Mathcad has built-in functions that help to import Excel data. You can use the READEXCEL function to specify the file and cells to import. Alternatively, the READEXCEL button on the Input / Output tab opens a user-friendly dialog box that will help you browse to the Excel file and specify which rows and columns to import.

By assigning the READEXCEL function to a variable, it becomes a matrix that you can use in vector and matrix functions and programs.
Since this function is part of a live worksheet, when you update the Excel spreadsheet, your matrices and calculations update when you recalculate the worksheet.

You can also embed an Excel component in your PTC Mathcad worksheet. The Excel component is a real Excel worksheet, and double clicking it opens your data inside Microsoft Excel.

The Excel component has Input and Output sections, so you can pass variables and values into and out of specified cells in the worksheet. Here is the lift calculation from the previous article embedded in my PTC Mathcad worksheet:

Spreadsheet calculations embedded in PTC Mathcad worksheet.

A traditional spreadsheet used to calculate aircraft lift. Data can be passed between PTC Mathcad as input and output.

This is a great way of leveraging pre-existing design information without reinventing the wheel.
If you are exchanging data with people in Excel format, you can use the WRITEEXCEL function to export a matrix, or part of a matrix, to an Excel spreadsheet.

Using PTC Mathcad to Drive a Design in Creo

We perform engineering calculations to design engineering models. Ideally, we want our engineering calculations to drive our CAD designs directly. There are two different ways to do this: either we can embed our PTC Mathcad worksheets into a Creo Parametric part or assembly, or we can connect our Creo models to a worksheet.

In the first method, we embed either a pre-existing or a new PTC Mathcad worksheet in a model using the Applications tab. In the second method, we use the Prime Analysis feature that calls a PTC Mathcad worksheet.

There are two essential differences between the methods: when you embed the worksheet and connect PTC Mathcad variables to parameters in the model, you can push the latest worksheet calculations to the model. Also, no separate file exists for the PTC Mathcad worksheet. When you connect the worksheet via the Prime Analysis feature, you can have the calculations re-performed on every regeneration if desired, and you have a separate worksheet file.

PTC Mathcad worksheet used to calculate values in Creo Parametric.
Example of a PTC Mathcad worksheet that receives values from Creo Parametric and returns calculations.

Both methods send values from Creo Parametric to the PTC Mathcad worksheet, perform calculations in the worksheet, and then return other values back. These values then drive model dimensions.

Design intent governs our modeling decisions in Creo Parametric, and embedding or connecting PTC Mathcad worksheets captures the design intent of our engineering calculations. We can ensure that our product geometry updates in ways that we plan and expect, based on real engineering knowledge.

The takeaway? By integrating Excel spreadsheets and Creo Parametric models with PTC Mathcad worksheets, you boost the power of your engineering calculations to accurately and reliably drive and communicate your design work. Want to learn more? Download the Mathcad Prime free trial.



Download Mathcad Prime!

Try the free 30-day trial of the latest version of PTC Mathcad Prime. Get my trial!

About the Author

Dave Martin

Dave Martin is a Creo, Windchill, and PTC Mathcad instructor and consultant. He is the author of the books “Top Down Design in Creo Parametric,” “Design Intent in Creo Parametric,” and “Configuring Creo Parametric,” all available at amazon.com. He can be reached at dmartin@creowindchill.com.

Dave currently works as the configuration manager for Elroy Air, which develops autonomous aerial vehicles for middle-mile delivery. Previous employers include Blue Origin, Amazon Prime Air, Amazon Lab126, and PTC. He holds a degree in Mechanical Engineering from MIT and is a former armor officer in the United States Army Reserves.