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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Custom functions in the relations dialog?

Chris3
21-Topaz I

Custom functions in the relations dialog?

Lets say instead of sin(x) I wanted to have a function square(x) where the function "square" would be the equivalent of x=y^2. Thus typing in a = square(2) would result in a value of 4 for "a".

If no one knows how to do this maybe I will fill out an enhancement request for it. I opened up a ticket with PTC, but wanted to see if anyone else had a cleaver idea here.


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
ACCEPTED SOLUTION

Accepted Solutions
dschenken
21-Topaz I
(To:James62)

This looks relevant. PTC Creo - PTC Creo 3.0 Top Enhancement: PTC Mathcad Integration

Skip the video, which does not show Mathcad Integration.

It is the same as the Excel analysis uses. I guess the integration is storing the Mathcad file inside the part or assembly file so they won't get separated.

Also this, however tedious it is. Nothing like a tutorial that includes slowly typing arbitrary names. http://learningexchange.ptc.com/tutorial/176/mathcad-and-creo-elements-pro-5-0-integration

Tutorial: Link PTC Mathcad Prime 3.1 Input Regions to PTC Creo Parametric Parameters This one I had to watch twice; there are a number of false leads that have nothing to do with the task at hand, such as hiding/unhiding items and reorienting the views for no reason except to confirm measurements that were already obvious and could be made in the trimetric orientation.

View solution in original post

6 REPLIES 6
TomD.inPDX
17-Peridot
(To:Chris3)

It would make thing a little simpler but I am not sure you would save anything since it is no different than a^2. typically you would assign a second variable anyway, so aa=a^2 would be the same as aa=square(a). And why would you stop at square; what about cubed and above?

Chris3
21-Topaz I
(To:TomD.inPDX)

Square was just for purposes of discussion. My actual equation that I want to turn into a function is a lot more complicated. I would rather not have to copy it a dozen times and then have to go back in, find and replace parts of it when it changes.

dschenken
21-Topaz I
(To:Chris3)

Relations is not a general purpose language, so there are no user-defined functions or subroutines. I keep hoping they integrate with something like AutoIt, but so far, no luck.

While J-Link and Weblink can offer what you are looking for, those act on the models, not from within the models; maybe an Excel analysis can be used?

James62
12-Amethyst
(To:Chris3)

For more complex functions you can use Mathcad Express in connection with Creo Parametric.

What is Mathcad Express?

dschenken
21-Topaz I
(To:James62)

This looks relevant. PTC Creo - PTC Creo 3.0 Top Enhancement: PTC Mathcad Integration

Skip the video, which does not show Mathcad Integration.

It is the same as the Excel analysis uses. I guess the integration is storing the Mathcad file inside the part or assembly file so they won't get separated.

Also this, however tedious it is. Nothing like a tutorial that includes slowly typing arbitrary names. http://learningexchange.ptc.com/tutorial/176/mathcad-and-creo-elements-pro-5-0-integration

Tutorial: Link PTC Mathcad Prime 3.1 Input Regions to PTC Creo Parametric Parameters This one I had to watch twice; there are a number of false leads that have nothing to do with the task at hand, such as hiding/unhiding items and reorienting the views for no reason except to confirm measurements that were already obvious and could be made in the trimetric orientation.

Chris3
21-Topaz I
(To:dschenken)

Thanks to both of you. I think this is probably the closest I will get.

Announcements


Top Tags