Solidworks-Mathcad Integration Install User Guide
Solidworks-Mathcad Integration Install User Guide
Introduction
The Solidworks-Mathcad integration provides users with an opportunity to combine both
products, allowing Solidworks dimensions to drive Mathcad calculations. The results of
these Mathcad calculations can then be sent back to Solidworks to optimize the design.
The end users can select which configuration within the Design Table they wish to be
manipulating with these numbers.
This utility is a non-supported example of how Mathcad and Solidworks can be used in
conjunction, based upon each product’s supported API.
It was built and tested on windows XP-32, using Solidworks 2010 and Mathcad 15.It also
supports Solidworks 2011.
Description
The integration is offered as a VB.NET DLL which implements the Solidworks AddIn
Class. This DLL uses both the Solidworks API and the Mathcad API to pass XML strings
between the 2 products.
In this case the designer can send height, width and length dimensions to a pre-
built Mathcad worksheet. This worksheet will use the parameters to calculate the
allowable pressure and then perform a simple comparison to see if this allowable
pressure meets design criteria.
2.) This same designer would like to minimize or maximize the size of his/her model
while staying within the limits of buckling. The earlier Mathcad worksheet can be
extended to include constraint based optimization. The results of this optimization
would be a new height, width and length. These new dimension values can be sent
back to Solidworks to update the model.
3.) Many ad-hoc calculations are done throughout the course of a design. Mathcad is
the ultimate tool for documenting those calculations and even tying the results of
those calculations to the model in Solidworks. This documentation can be
submitted with the Solidworks model to whatever Document Management/PLM
system the user has installed.
4.) Some design engineers wish to use math equations to generate geometries. These
calculations can easily be done in Mathcad and the output data will be can be sent
to Solidworks.
How to install
1.) Register the Mathcad DLL using the regasm utility.
C:\WINNT\Microsoft.NET\Framework\v4.0.30319
2.) Attach the Add-In to the Solidworks Interface through the Tools menu.
d. Using the Solidworks Tools Add-Ins menu, check the box to select
Mathcad_15.
e. Select “OK”.
3.) Verify that the Mathcad_15 menu item has been added to the Solidworks menu
bar.
SCALAR VALUES
How to prepare your Mathcad worksheet for use in the integration
The first step is to decide what model in Solidworks you want to tie to Mathcad
calculations.
Once this is done, you need to think about what calculations you want to drive the model
you have in mind. Many pre-built calculations exist in Mathcad Libraries and Extension
Packs. Of course Mathcad allows you to build your own equations in natural math
notation with units on the terms or systems of linear and non-linear equations, or
optimization calculation and more.
OK, assume now we have our CAD model and we have our calculations in Mathcad.
Looking at the Mathcad worksheet, decide which variables you want to have driven by
the Solidworks model. Also decide which Mathcad variables you want to send to
Solidworks to modify the CAD model.
The Mathcad variables you want to have driven by Solidworks need to be tagged
as”SW2MC”. To do this simply right mouse click on the region, select properties. In the
TAG text box type (in capitols) SW2MC.
The dimensions you want to send to Solidworks from Mathcad need to be tagged
as”MC2SW”. To do this simply right mouse click on the region, select properties. In the
TAG text box type (in capitols) MC2SW.
Now your worksheet is prepped and the integration is ready to go. The tags must be set
before loading the Mathcad worksheet into the integration.
Use the Select Design Table dropdown to select which configuration of the loaded part
you wish have the integration interact with.
Curves are simply 3 column matrices, each row being a xyz triplet The included
worksheet, matrix.xmcd, shows an example called sindata. You can see how we use the
Mathcad function augment to create the sindata 3 column matrix.
Curves with the TAG MC2SW will populate the “curves” drop down at the bottom of the
Mathcad Panel.
Matrices also need to be tagged MC2SW. Their formatting is a bit tricky. Each 3 columns
must represent a curve. You may have many columns depending on the number of
vertical lines in your surface. Each row must also represent x,y,z triplets representing the
horizontal lines in the surface.
You can see how we use an inline function called build_array to map your surface data
into spline triplets in the matrix.xmcd example included.
Select the curve or matrix you want created in Solidworks from the drop downs called
Curves and Matrices. After selecting a data set then click the send button.
When first trying curves and matrices, In Solidworks create a new part “3D
representation of a single design component”. Also use the zoom to fit or zoom to area in
Solidworks under View-<Modify to help see your data