0% found this document useful (0 votes)
15 views5 pages

SolidWorks Mathcad Integration Guide

The SolidWorks-Mathcad integration allows users to link SolidWorks dimensions with Mathcad calculations, enabling design optimization. It utilizes a VB.NET DLL to facilitate communication between the two software through XML strings. Users can perform analyses and optimizations in Mathcad based on SolidWorks models and vice versa by tagging variables appropriately.

Uploaded by

yeciwo5599
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views5 pages

SolidWorks Mathcad Integration Guide

The SolidWorks-Mathcad integration allows users to link SolidWorks dimensions with Mathcad calculations, enabling design optimization. It utilizes a VB.NET DLL to facilitate communication between the two software through XML strings. Users can perform analyses and optimizations in Mathcad based on SolidWorks models and vice versa by tagging variables appropriately.

Uploaded by

yeciwo5599
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

SolidWorks – Mathcad User Guide

Introduction
This integration provides users with an opportunity to combine both products, allowing
SolidWorks dimensions to drive Mathcad calculations. The results of those calculations
can then be sent back to SolidWorks to optimize the design.

This utility is a non-supported example of how Mathcad and SolidWorks can be used in
conjunction, based upon each product’s supported API.

Description
The integration is offered as a [Link] 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.

Use Case Scenarios


1.) An engineer has design a model in SolidWorks and wishes to do a quick analysis
to see if this design will buckle under a certain pressure. Mathcad is not an FEA
tool like Cosmos, but given height, width and length, Mathcad can do a
scratchpad analysis to allow the designer to quickly understand if he has derailed
his design.

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 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.

How to install
1.) Register the Mathcad DLL using the regasm utility.

a. Open a command window.


b. Change the directory to your [Link] Framework version directory,:
C:\windows\[Link]\framework\v1.1.4322

c. At the command prompt, type the following command:

regasm C:\mathcad\mathcad_14.dll /codebase

where c:\mathcad\mathcad_14.dll represents the directory where your


mathcad_14.dll file is located.

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_14.

e. Select “OK”.

3.) Verify that the Mathcad_14 menu item has been added to the SolidWorks menu
bar.
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 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 variables 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.

How to use the integration


To use the SolidWorks-Mathcad integration, load the SolidWorks model discussed earlier
into SolidWorks. Under the Mathcad_14 toolbar menu select Mathcad and then launch
the Mathcad Properties Panel
Use the drop downs on the left to map values to the selected values in the drop down on
the right.

Use the 2 submit buttons to transfer from SolidWorks to Mathcad or vice-versa.


With the example Mathcad worksheet and SolidWorks CAD part provided try the
following mapping

Map : SolidWorks Mathcad


D5@sketch1 w
D1@sketch1 d.b
D2@sketch1 d.r
D1@sketch4 z

Map : Mathcad SolidWorks


new_db D1@sketch1
new_dr D2@sketch1
new_z D1@sketch4

Common questions

Powered by AI

Mathcad's pre-built libraries can be utilized alongside SolidWorks to perform complex calculations that were predefined for engineering problems. These libraries offer various mathematical computations that can be directly tied to SolidWorks models. For instance, engineers can streamline analysis processes such as linear and nonlinear calculations or optimization by directly linking these libraries' equations to SolidWorks dimensions. This offers a versatile toolkit for solving several engineering problems and enhancing design accuracy and efficiency .

The 'regasm' utility is important in the integration process because it registers the Mathcad DLL with the .NET Framework. This registration process is crucial for making Mathcad features available as a SolidWorks add-in. By compiling the Mathcad DLL into a format that can be consumed by the integrated development environment, 'regasm' essentially links the functionalities of Mathcad into SolidWorks, ensuring that engineers have full access to Mathcad's computational capabilities directly from the SolidWorks platform .

To prepare a Mathcad worksheet for integration with SolidWorks, first identify which CAD model variables need to be controlled by Mathcad calculations and vice versa. Variables from SolidWorks that will influence Mathcad calculations must be tagged as 'SW2MC', while those going from Mathcad to SolidWorks should be marked 'MC2SW'. This is done by right-clicking on the Mathcad region corresponding to these variables, selecting properties, and entering the appropriate tag in the TAG text box. This setup ensures a clear mapping of variables in both directions and prepares the worksheet for seamless integration .

Determining which SolidWorks model parameters to drive with Mathcad calculations involves several considerations: the critical nature of each parameter in influencing overall design performance, the availability of corresponding Mathcad equations capable of analyzing those parameters, and the potential benefits in design improvement and optimization. Engineers should prioritize parameters that significantly affect design constraints like weight, durability, or structural integrity. Additionally, it's essential to ensure that the mathematical calculations in Mathcad align with these parameters to facilitate accurate and efficient analysis and modification of the CAD model .

Using Mathcad as a documentation tool alongside SolidWorks for engineering calculations offers several benefits. It provides a clear and structured format for recording complex calculations, which is valuable for reference, validation, and auditing purposes. This documentation can be linked with SolidWorks models in Product Lifecycle Management (PLM) systems, enhancing traceability and ensuring consistency in design processes. Mathcad also allows engineers to integrate units into calculations naturally, reducing errors and improving the reliability of reported data, ultimately fostering a more systematic approach to design iterations and technical reporting .

XML strings are used as the medium for data exchange between SolidWorks and Mathcad by encoding model parameters and calculation results in a standardized format that both applications can interpret. When SolidWorks dimensions are sent to Mathcad for analysis, they are encapsulated within an XML string. Mathcad processes this data and outputs the results, formatted as another XML string, which SolidWorks can receive and use to update the model. This method allows seamless data transfer, ensuring that each platform maintains the fidelity of the parametric data involved .

The API plays a crucial role in integrating Mathcad and SolidWorks by facilitating communication between the two software programs. Specifically, it enables the transfer of XML strings containing data and variables, allowing SolidWorks to pass dimensional data to Mathcad for calculations and then receive updated parameters back after Mathcad processes them. This makes the integration functional and seamless, allowing for optimization and analysis directly driven by the model's dimensions .

Constraint-based optimization using the integration of SolidWorks and Mathcad can be accomplished by first setting up a Mathcad worksheet that defines the design constraints, such as limits on dimensions or stresses. The existing model dimensions are sent from SolidWorks to Mathcad, where calculations are performed to find the optimal design parameters within the defined constraints. Subsequently, Mathcad sends the optimized variables back to SolidWorks to update the model dimensions. This feedback loop allows continuous refinement of the design to achieve the best possible size and performance while meeting all engineering constraints .

The integration between SolidWorks and Mathcad allows engineers to conduct quick analyses and constraint-based optimizations without exiting the design environment. SolidWorks dimensions can drive Mathcad calculations, enabling engineers to perform scratchpad analyses for structural integrity checks like pressure buckling. These calculations help engineers decide whether their designs meet certain criteria. Additionally, optimization results can be fed back to SolidWorks to update and optimize the model's dimensions, ensuring that design modifications adhere to operational constraints while aiming to minimize size .

Attaching the Mathcad Add-In to the SolidWorks Interface involves a few simple steps: 1) Access the SolidWorks Tools menu and select the Add-Ins option. 2) Within the Add-Ins menu, check the box for Mathcad_14 to select it. 3) Click 'OK' to finalize the attachment process. This procedure allows Mathcad's capabilities to be accessible directly within SolidWorks, enabling engineers to leverage advanced calculations for model optimization and analysis .

You might also like