Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

SolidWorks - PTC Mathcad

Prime 3.1
Integration User Guide

Copyright 2015 PTC Inc. and/or Its Subsidiary Companies. All Rights Reserved.
User and training guides and related documentation from PTC Inc. and its subsidiary companies (collectively
"PTC") are subject to the copyright laws of the United States and other countries and are provided under a
license agreement that restricts copying, disclosure, and use of such documentation. PTC hereby grants to the
licensed software user the right to make copies in printed form of this documentation if provided on software
media, but only for internal/personal use and in accordance with the license agreement under which the
applicable software is licensed. Any copy made shall include the PTC copyright notice and any other
proprietary notice provided by PTC. Training materials may not be copied without the express written consent
of PTC. This documentation may not be disclosed, transferred, modified, or reduced to any form, including
electronic media, or transmitted or made publicly available by any means without the prior written consent of
PTC and no authorization is granted to make copies for such purposes.
Information described herein is furnished for general information only, is subject to change without notice,
and should not be construed as a warranty or commitment by PTC. PTC assumes no responsibility or liability
for any errors or inaccuracies that may appear in this document.
The software described in this document is provided under written license agreement, contains valuable trade
secrets and proprietary information, and is protected by the copyright laws of the United States and other
countries. It may not be copied or distributed in any form or medium, disclosed to third parties, or used in any
manner not provided for in the software licenses agreement except with written prior approval from PTC.
UNAUTHORIZED USE OF SOFTWARE OR ITS DOCUMENTATION CAN RESULT IN CIVIL
DAMAGES AND CRIMINAL PROSECUTION. PTC regards software piracy as the crime it is, and we view
offenders accordingly. We do not tolerate the piracy of PTC software products, and we pursue (both civilly
and criminally) those who do so using all legal means available, including public and private surveillance
resources. As part of these efforts, PTC uses data monitoring and scouring technologies to obtain and transmit
data on users of illegal copies of our software. This data collection is not performed on users of legally
licensed software from PTC and its authorized distributors. If you are using an illegal copy of our software
and do not consent to the collection and transmission of such data (including to the United States), cease
using the illegal version, and contact PTC to obtain a legally licensed copy.
Important Copyright, Trademark, Patent, and Licensing Information: See the About Box, or copyright
notice, of your PTC software.

UNITED STATES GOVERNMENT RESTRICTED RIGHTS LEGEND


This document and the software described herein are Commercial Computer Documentation and Software,
pursuant to FAR 12.212(a)-(b) (OCT95) or DFARS 227.7202-1(a) and 227.7202-3(a) (JUN95), and are
provided to the US Government under a limited commercial license only. For procurements predating the
above clauses, use, duplication, or disclosure by the Government is subject to the restrictions set forth in
subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software Clause at DFARS 252.2277013 (OCT88) or Commercial Computer Software-Restricted Rights at FAR 52.227-19(c)(1)-(2) (JUN87),
as applicable. 01012015
PTC Inc., 140 Kendrick Street, Needham, MA 02494 USA

Contents

Support ......................................................................................................................5
Introduction to Integration ............................................................................................7
Description...........................................................................................................8
Use Case Scenarios .............................................................................................8
Installation ..................................................................................................................9
Scalar Values............................................................................................................13
Preparing Your Worksheet...................................................................................14
How to Use the Integration ..................................................................................15
Mapping of Variables...........................................................................................15
Index........................................................................................................................17

Support

Technical Support
Contact PTC Technical Support via the PTC Web site, phone, fax, or e-mail if you
encounter problems using PTC Mathcad Prime. For details, refer to Contacting
Technical Support in the PTC Customer Service Guide included with your
shipment. This guide can also be found on the Services and Support page of the
PTC Web site at:
www.ptc.com/support/cs_guide/index.htm
You must have a Service Contract Number (SCN) before you can receive
technical support. If you do not have a number, contact PTC Maintenance
Department by calling the customer care line listed at the back of your PTC
Customer Service Guide or by using the online Customer Care Call Logger
on the Customer Support Web site.

Documentation for PTC Products


PTC provides documentation in the following forms:

Help topics

Printed installation guide

PDF books

You can find PDF files of all documents in the Books section of the Help Center,
on the product CD-ROM, or on the PTC Web site. On the Web site, choose the
product or document type:
www.ptc.com/appserver/cs/doc/refdoc.jsp

To view and print PDF books, you must have the Adobe Acrobat Reader
installed. You can download the software from the following address:
www.adobe.com/support/downloads/main.html

To access all PTC documentation, you must have a valid user account. To
request one, go to the following address:
www.ptc.com/appserver/common/account/basic.jsp

Feedback to Documentation
PTC welcomes your suggestions and comments on its documentation - send
comments to the following address:
doc-webhelp@ptc.com
Please include the name of the application and its release number with your
comments. For online books, provide the book title.

Documentation Conventions
PTC documentation uses the following conventions:
Convention
Bold

Italic

Monospace

Quotation marks

Item
Names of elements in the
user interface such as
buttons, menu paths, and
dialog box titles.

Example
Click OK. Select File >
Save. License File dialog
box.
create_<tablename>.sql

Required elements and


keywords or characters in
syntax formats.
Variable and user-defined create_<tablename>.sql
elements in syntax
formats. Angle brackets
(< and >) enclose
individual elements.
Examples
JavaGen wt.doc.* F
true
Messages

Strings

Processing
completed.
The string UsrSCM . . .

SolidWorks - PTC Mathcad Prime 3.1 Integration User Guide

1
Introduction to Integration
Description .................................................................................................................8
Use Case Scenarios ....................................................................................................8

The SolidWorks-PTC Mathcad Prime integration provides users with an


opportunity to combine both products, allowing Solidworks dimensions to drive
PTC Mathcad Prime calculations. The results of these PTC Mathcad Prime
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 PTC Mathcad Prime and
SolidWorks can be used in conjunction, based upon each products supported API.
The source code is part of the PTC Mathcad Prime SDK and is a supported
product.
It was built and tested on Windows 7 64-bit, using SolidWorks 2014 and PTC
Mathcad Prime 3.1. It also supports SolidWorks 2012 and SolidWorks 2015.

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 PTC Mathcad
Prime API to pass values and results between the two products.

Use Case Scenarios


Stress Analysis
An engineer has designed a model in SolidWorks and wishes to do a quick
analysis to see if this design buckles under a certain pressure. PTC Mathcad Prime
is not an FEA tool like Cosmos, but given height, width and length, it can perform
stress and strain analysis to allow the designer to quickly understand if he/she has
derailed his design.
In this case the designer can send height, width and length dimensions to a prebuilt PTC Mathcad Prime worksheet. This worksheet uses the input parameters
from SolidWorks to calculate the allowable pressure and then perform a simple
comparison to see if this allowable pressure meets design criteria.
Minimize/Maximize Analysis
The same designer would like to minimize or maximize the size of the model
while staying within the limits of buckling. The above PTC Mathcad Prime
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.
Ad-hoc Analysis
Many ad-hoc calculations are done throughout the course of a design. PTC
Mathcad Prime 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.
Geometry Generation
Some design engineers use math equations to generate geometries. These
calculations can easily be done in PTC Mathcad Prime and the output data can be
sent to SolidWorks.

SolidWorks - PTC Mathcad Prime 3.1 Integration User Guide

2
Installation
1. Register the Mathcad DLL using the regasm utility.
a. Open a command window as Administrator (All Files -> Accessories ,
locate the Command Prompt and RMB run as Administrator).
b. Change the directory to your Microsoft.Net Framework version directory.
For example:
C:\Windows\Microsoft.NET\Framework\v4.0.30319
c. At the command prompt, type the following command:
RegAsm C:\mathcad\mathcadprime.dll /codebase
where c:\mathcad represents the directory where your
mathcadprime.dll and SolidWorksTools.dll files are located.
These are the files in the download which represent the integration code.
2. Attach the Add-In to the SolidWorks Interface through the Tools menu.
a. Using the SolidWorks Tools > Add-Ins menu, check the box to select
Mathcad Prime.

b. Select OK.
3. Verify that the Mathcad Prime menu item has been added to the SolidWorks
menu bar.

10

SolidWorks - PTC Mathcad Prime 3.1 Integration User Guide

Installation

11

3
Scalar Values
Preparing Your Worksheet .........................................................................................14
How to Use the Integration .........................................................................................15
Mapping of Variables .................................................................................................15

13

Preparing Your Worksheet


This section explains how to prepare your PTC Mathcad Prime worksheet for use
in the integration.
The first step is to decide what model in SolidWorks you want to tie to PTC
Mathcad Prime 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 worksheet calculations are available on
the PTC website. Of course PTC Mathcad Prime 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 calculations, and more. To view the site, on
the Resources tab, in the Connect to PTC Mathcad Community group, click
Engineering Resources.

Assume that you have a CAD model and that you have your own calculations in
PTC Mathcad Prime. Looking at your PTC Mathcad Prime worksheet, decide
which variables you want to be driven by the Solidworks model. Also decide
which Mathcad variables you want to send back to SolidWorks to modify the
CAD model.
The regions that contain the Mathcad variables that you want to be driven by
Solidworks must be tagged as input regions. To do this, select the regions, then on
the Input/Output tab, in the Integration group, click Assign Inputs.

The regions that contain the Mathcad variables that you want to send back to
Solidworks must be tagged as output regions. To do this, select the result regions,
then on the Input/Output tab, in the Integration group, click Assign outputs.

Now your worksheet is prepared and the integration is ready to go. The input/
output region tags must be set before loading the PTC Mathcad Prime worksheet
into the integration.

14

SolidWorks - PTC Mathcad Prime 3.1 Integration User Guide

How to Use the Integration


To use the SolidWorks-PTC Mathcad Prime integration, load the SolidWorks
model discussed earlier into SolidWorks. From the Mathcad Prime toolbar menu
select Mathcad Prime and then launch the Mathcad Prime integration UI Panel.

Use the Load Mathcad Worksheet to launch PTC Mathcad Prime and load the
appropriate worksheet. Use the drop downs on the left to map values to the
selected values in the drop down on the right.
Use the Select Design Table dropdown to select which configuration of the loaded
part you wish have the integration interact with.

Mapping of Variables
Use the two submit buttons to transfer from SolidWorks to Mathcad Prime or
vice-versa. Using the provided Mathcad Prime worksheet example and the
Solidworks CAD part, try the following mapping:
Map:

Scalar Values

SolidWorks
D5@sketch1
D1@sketch1
D2@sketch1
D1@sketch4

Mathcad
w
d.b
d.r
z

15

Map:

16

Mathcad
new_db
new_dr
new_z

SolidWorks
D1@sketch1
D2@sketch1
D1@sketch4

SolidWorks - PTC Mathcad Prime 3.1 Integration User Guide

Index

D
Documentation
Conventions, 6
Sending comments to PTC, 6

I
Installation, 9
Integration
Description, 7-8
Introduction, 7-8
Use Case Scenarios, 7-8

S
Scalar Values, 13-15
How to Use the Integration, 13-15
Mapping of Variables, 13-15
Preparing Your Worksheet, 13-15

17

You might also like