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

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Create Functions on relations

xureta
4-Participant

Create Functions on relations

I am using Pro/ENGINEER and Creo Elements/Pro Release Wildfire 4.0 and DatecodeM130

I want to use the same relation using measurements of the model many times. Instead of repeating the same relation for each used measurement, is it possible to create a function where each time it is needed on the Relations it could be called specifying the value needed to perform the calculation.
For instance, in Python would be something like this:

#Function definition:
def sum(a, b):
return a + b

#When the function is needed would be called like this:
sum(3, 4)

Result --> 7

3 REPLIES 3
Chris3
20-Turquoise
(To:xureta)

It is not part of Creo functionality to create functions in relations.

 

You can however create mapkeys to automate typing in relations. You can also create UDFs that have relations built in. Lastly there are several toolkits available (jlink, weblink, vb, etc) that allow you to more fully automate Creo. If you are interested in automating Creo there is going to be a webinar this Thursday at 1pm EST talking about just that:

https://ptc.zoom.us/webinar/register/WN_q7sn4TyDQaG328fc8SVDcQ

KenFarley
21-Topaz I
(To:xureta)

This isn't possible. Relations are processed in a serial manner every time you regenerate. There is no looping or function definition capability, regrettably. That's why if you need to do something like calculate the closest fraction based on a floating point value, or generate a few strings from real numbers, you end up with a very long list of relations, with many IF - ELSE- ENDIF statements.

tbraxton
21-Topaz II
(To:xureta)

If you have a license for the BMX module you can use an Excel analysis feature which would may support what you are trying to do.

 

http://support.ptc.com/help/creo/creo_pma/usascii/index.html#page/model_analysis%2Fbemod%2FTo_Create_an_Excel_Analysis_Feature.html%23wwconnect_header 

========================================
Involute Development, LLC
Consulting Engineers
Specialists in Creo Parametric
Top Tags