Skip to main content
21-Topaz I
April 21, 2015
Solved

Custom functions in the relations dialog?

  • April 21, 2015
  • 1 reply
  • 2951 views

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.
Best answer by dschenken

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.

1 reply

17-Peridot
April 21, 2015

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?

Chris321-Topaz IAuthor
21-Topaz I
April 21, 2015

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.

1-Visitor
April 21, 2015

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?