Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
This is a document so please edit it and add, correct, &/or clarify how you see fit. Then we can all use this as a point of reference when dealing with Repeat Regions/BOM programming. If you don't want to edit it but still want to contribute, then just leave a comment. Thanks!
List of System Parameters and Model Parameters used in model/drawing (Document - CS133915):
List of Operators and Functions:
Type |
Name |
syntax |
Explanation |
eg: Input |
|
Eg: output |
= |
MyVar="string" |
Defines, or assigns, a variable as a # or string
|
MyVar="H123" MyVar=10 |
= = |
No Output but defines the variable MyVar to be: H123 10 |
|
|
==
== |
A==B
#A==#B |
Compares strings as equal.
Compares #s as equal |
"456"=="123" "456"=="456"
7==1 7==7 |
= =
= = |
NO YES
NO YES |
|
!=, <>, ~= |
A!=B A<>B A~=B
#A!=#B #A<>#B #A~=#B
|
Compares strings as unequal. (checks to see if not equal or not)
Compares #s as unequal. (checks to see if not equal or not)
|
"456"<>"123" "456"<>"456"
7!=1 7<>1 7~=1 7!=7 7<>7 7~=7 |
= =
= = = = = = |
YES NO
YES YES YES NO NO NO |
+
+ |
A+B
#A+#B |
For Strings: Concatenate strings. For Numbers: Add #s (Addition, Plus) |
"456"+"123"
7+7 |
=
= |
456123 (returns a string e.g. "456123"*1="ERROR") 14 |
|
- |
#A-#B |
Subtract #s (Subtraction, Take away, Minus) |
3-2 |
= |
1 |
|
/ |
#A/#B |
Divide #s (Division) |
6/2 |
= |
3 |
|
* |
#A*#B |
Multiply #s (Multiplication) |
6*2 |
= |
12 |
|
^ |
#A^#B |
A to the Power of B (Exponent, Powers, Raised to) |
2^3 |
= |
8 |
|
() |
(#A-#B)*#C |
Parentheses for grouping, Priority, and order of operations |
(3-2)*4 4*(3-2) |
= = |
4 4 |
|
== |
|
<See String Operators above> |
|
|
|
|
> |
#A>#B |
Greater than |
|
|
|
|
>= |
#A>#B |
Greater than or equal to |
|
|
|
|
!=, <>,~= |
|
<See String Operators above> |
|
|
|
|
< |
#A<#B |
Less than |
|
|
|
|
<= |
#A<#B |
Less than or equal to |
|
|
|
|
| |
#A | #B | #C |
OR |
|
|
|
|
& |
#A & #B & #C |
AND |
|
|
|
|
~,! |
#A == !B
#A!=B #A~=B |
NOT (i.e. Reverse a statement, Opposite) (
Tilde ~ doesn't work for NOT next to a #. Only next to operator = |
7 == 7 7 == !7 7 == !4 7> 4 7>!4
7 != 7 7>=3 7!>=3 7~=7 7~=4
7 == ~7 7 == ~4 "ABC" == !"ABC" |
= = = = =
= = = = =
= = = |
YES NO NO YES YES (I guess even mathematically this is strange)
NO YES NO NO YES
ERROR ERROR ERROR |
|
abs |
abs(#) |
Returns the absolute value of a number |
abs(-2) |
= |
2 |
|
acos |
acos(#º) |
Returns the arccosine of a number |
ACOS(0.125) |
= |
1.445468496 |
|
asin |
asin(#º) |
Returns the arcsine of a number |
ASIN(0.125) |
= |
0.125327831 |
|
atan |
atan(#º) |
Returns the arctangent of a number |
ATAN(0.125) |
= |
0.124354995 |
|
atan2 |
atan2(#º) |
Returns the arctangent (inverse tangent), of the specified x- and y-coordinates |
ATAN2(2,3) |
= |
0.982793723 |
|
bound |
bound(#x,#lo,#hi) |
Forces #x to be within the range of #lo to #hi.
(kind of the opposite as DEAD(), but not exactly) |
|
= = = |
|
|
|
cable_len |
|
|
|
= |
|
ceil |
ceil(#) |
Round # up |
ceil(3.25) |
= |
4.0000 |
|
|
comparegraphs |
|
|
|
= |
|
cos |
cos(#º) |
Returns the Cosine of a # |
cos(2) |
= |
-0.416146837 |
|
cosh |
cosh(#º) |
Returns the hyperbolic Cosine of a # |
cosh(2) |
= |
3.762195691 |
|
|
dbl_in_tol |
dbl_in_tol (#x, #y, #r) |
Checks to see if x and y are within the tolerance of ± r
|
dbl_in_tol (2, 1, 1) dbl_in_tol (2,1,0.5) dbl_in_tol (10,20,9) dbl_in_tol (10,20,10) dbl_in_tol (10,20,11) |
= = = = = |
YES NO NO YES YES |
dead |
dead(#x,#lo,#hi) |
"Defines a range of values for x, for which the result of the function is 0."
(kind of the opposite as BOUND(), but not exactly) |
|
= = = |
|
|
Cabling, Case Study Functions |
eang |
eang(e_ID1, e_ID2) |
Angle in radians between two entities, e_ID1 and e_ID2, of a case study |
|
= |
|
Cabling, Case Study Functions |
ecoordx |
ecoordx(e_ID1) |
x coordinate of the e_ID1 entity of a case study |
|
= |
|
Cabling, Case Study Functions |
ecoordy |
ecoordy(e_ID1) |
y coordinate of the e_ID1 entity of a case study |
|
= |
|
Cabling, Case Study Functions |
edistk |
edistk(e_ID1, e_ID2) |
Distance between two entities, e_ID1 and e_ID2 |
|
= |
|
Cabling, Case Study Functions |
elen |
elen(e_ID1) |
Length of the e_ID1 entity of a case study |
|
= |
|
evalgraph |
evalgraph("graph_name", x) |
Graph evaluation function enables you to use graph features to drive dimensions through relations. The dimensions can be section, part, or assembly dimensions.
|
|
= |
|
|
exists("x") |
Test if a parameter, variable, or dimension exists or not
x is a string |
EXISTS("ASM_MBR_NAME") EXISTS("ASM_MBR_NAME_") EXISTS("test03") |
= = = |
YES NO YES (note test03 is a defined variable in my relations) |
||
exp |
exp(#) |
e3 Returns e raised to the power of a number, where e = Euler's number = 2.718… |
exp(3)=e3 |
= |
20.085537 |
|
extract(#1,#2,#3) |
Extracts pieces of strings. #1=string analyzing #2=starting position #3=length (how many char to extract)
e.g. looking at the entire string (4324870B) Starting with the first character (4) Extract 7 characters (4324870) |
extract("4324870B",1,7)
Extract("4324870B",8,1) |
=
= |
4324870
B |
||
False* |
false() false |
False function Returns "No" (For some reason doesn't return "False"!) |
False() False |
= = |
NO FALSE |
|
floor |
floor(#) |
Round # down |
Floor(3.25) |
= |
3.0000 |
|
if |
IF(c,x,y) |
Similar to IF() function in Excel: c= condition statement x = what to do if true y= what to do if false (PTC documentation calls this a switching function but to me is too basic to earn this title) |
IF(10==9,2,10) |
= |
10.0 |
|
if, Else, Endif |
IF <condition> <what to do if condition is met>
ELSE <what to do if condition is not met> (optional)
ENDIF |
If--Starts the if statement Else--says what to do if statement is not bet (and is optional) Endif--(closes the if statement)
|
asm_mbr_name = 4564870B IF string_length(asm_mbr_name) > 7 Test01 = extract(asm_mbr_name,1,8) ELSE Test01 = extract(asm_mbr_name,1,7) ENDIF |
= |
4564870B |
|
itos |
itos(#) |
Integer to String-- Reads in an integer and returns a string. If the input number is a # that is not an integer, itos rounds up, than converts to a string. |
itos(6) itos(6.7) |
= = |
6 7 |
|
ln |
ln(#) |
Returns the natural log (base e) of a # |
ln(2) |
= |
0.693147181 |
|
log |
log(#) |
Returns the base 10 logarithm of a # |
log(2) |
= |
0.301029996 |
|
|
lookup_inst ("generic_name", match_mode, "param_name_1", match_value_1, "param_name_2", match_value_2,...) |
Used in ProPROGRAM Used to automatically replace the given Family Table instance with another FT instance: •generic name—Name of the generic model with a prt or asm extension •match_mode—One of the following values:
•param_name_1—Family table parameter name •match_value_1—Value to match against |
INPUT END INPUT RELATIONS INST_NAME = LOOKUP_INST ("PEG.PRT", 0, "D2", D6:0, "D1", D5:0 + 1) END RELATIONS ADD PART BLOCK INTERNAL COMPONENT ID 1 END ADD ADD PART (INST_NAME) INTERNAL COMPONENT ID 2 PARENTS = 1 (#1) END ADD MASSPROP END MASSPROP |
--> |
"In this way, the instance of peg.prt being assembled to blockpeg.asm is controlled, based on the dimensions of the hole in block.prt."
|
|
|
massprop_param |
|
|
|
= |
|
|
material_param |
|
|
|
= |
|
max |
max(#) |
Compares 2 #s and returns the larger one |
max(6.2,4) |
= |
6.2 |
|
min |
min(#) |
Compares 2 #s and returns the smaller one |
min(6.2,4) |
= |
4 |
|
mod |
mod(#n,#d) |
Modulus function. Also known as Remainder function because gives just the remainder. e.g. n/d (numerator/denominator): 10/2=5 Remainder=0 (10/2+0/2) 10/3=3 Remainder=1 (9/3+1/3) 10/4=2 Remainder=2 (8/4+2/4)
In Programming Modulus can be useful to do many things. e.g.
[mod(9+5,12)=2pm]
[given mod(n,360) to determine what quadrant a particular angle falls in for the unit circle) If Remainder 270-360, then Quad.4] |
Mod(10,2) Mod(10,3) Mod(10,4)
Mod(9+5) Mod(9+8,12)
Mod(400,360)
Mod(2300,360) |
= = =
= =
=
= |
0 1 2
2 (e.g. 9am+5hrs =2pm) 5 (e.g. 9am+8hrs = 5pm)
40 (40º is in quadrant 1)
140 (140º is in quadrant 2) |
|
|
mp_assigned_mass |
|
|
|
= |
|
|
mp_cg_x |
|
|
|
= |
|
|
mp_cg_y |
|
|
|
= |
|
|
mp_cg_z |
|
|
|
= |
|
|
mp_mass |
|
|
|
= |
|
|
mp_surf_area |
|
|
|
= |
|
|
mp_volume |
|
|
|
= |
|
near |
near(#y,#y,#delta) |
determines if the numbers x and y are within delta of each other |
near(5,8,3) near(5,8,1) |
= = |
1.0 (i.e. when true) 0.0 (i.e. when false) |
|
No* |
no() no |
No Function Returns "No" |
No() No |
= = |
NO FALSE |
|
pi |
pi() |
Returns the number for PI |
PI() |
= |
3.141592654 |
|
pow |
pow(#x,#y) |
x^y Raising x to the Power of y #1=Base value #2=Exponent |
Pow(1,2) Pow(2,2) Pow(2,4) |
= = = |
1.0 (i.e. 1^2) 4.0 (i.e. 2^2) 16.0 (i.e. 2^4) |
|
rel_model_name |
rel_model_name
or
rel_model_name() |
|
rel_model_name
rel_model_name() |
= |
501234 (when done on 501234.drw table repeat region relations) |
|
rel_model_type
|
rel_model_type
or
rel_model_type() |
Returns the current model type. If you are working in Assembly mode, rel_model_type() is equal to assembly.
(note you can use with or without parenthesis) |
rel_model_type
rel_model_type() |
= |
DRAWING (when used in table repeat region relations) |
|
search |
search(string, substring) |
Searches for substrings. The resulting value is the position of the substring in the string (0 if not found). You can specify substrings with single or double quotes. |
search(asm_mbr_name,"501234") |
= |
2 (Given asm_mbr_name is 05012340.prt) |
|
sign |
sign(x,y) |
Sign Transfer of y to x
|
sign(-2,3) sign(2,3) sign(2,-3) sign(-2,-3) |
= = = = |
2.0 2.0 -2.0 -2.0 |
|
sin |
sin(#º) |
Returns the sine of a number |
sin(2) |
= |
0.909297427 |
|
sinh |
sinh(#º) |
Returns the hyperbolic sine of a number |
sinh(2) |
= |
3.626860408 |
|
|
smt_def_ben_rad |
|
|
|
= |
|
|
smt_thickness |
|
|
|
= |
|
sqrt |
sqrt(#) |
Take the square root of a number |
sqrt(4) |
= |
2 |
|
string_ends |
string_ends (string1, string2) |
Check to see if string1 ends with string2 Case Sensitive ("H" <NOT => "h") |
string_ends("h456","56") string_ends("h456H","56h") string_ends("h456H","56H") |
= = = |
YES NO YES |
|
string_length |
string_length(string)
string_length(<param>) |
Returns the number of characters in a string or parameter. |
string_length("als23fj") string_length(asm_mbr_name) |
= = |
7.0 6.0 (when done on 501234.prt table repeat region relations) |
|
string_match |
string_match(string1, string2) |
Check to see if 2 strings are exactly the same or not Case insensitive ("H"="h") |
string_match("456","456") string_match("456","4560") string_match("h456","H456") |
= = = |
YES NO YES |
|
string_starts |
string_starts(string1, string2) |
Check to see if string1 starts with string2 Case Sensitive ("H" <NOT => "h") |
string_starts("h456","h4") string_starts("h456","H4") string_starts("h456","asd4") |
= = = |
YES NO NO |
|
tan |
tan(#º) |
Returns the tangent of a number |
tan(2) |
= |
-2.185039863 |
|
tanh |
tanh(#º) |
Returns the hyperbolic tangent of a number |
tanh(2) |
= |
0.96402758 |
|
|
trajpar |
|
"Trajectory Parameter" Returns a system of numbers that varies from 0 to 1 across the length of a given path |
sin(trajpar*8*pi()) |
= |
creates an undulating wave |
trajpar_of_pnt |
trajpar_of_pnt("trajname", "pointname") |
The trajectory parameter of a composite curve, trajpar_of_pnt, can be used in relations. The following function returns a value between 0.0 and 1.0: |
|
= |
|
|
True* |
true() true |
True function Returns "YES" (For some reason doesn't return "True"!) |
True() True |
= = |
YES TRUE |
|
Yes* |
yes() yes |
Yes function Returns "Yes" |
Yes() Yes |
= = |
YES TRUE |
*Relations containing conditional statements are not sorted. A condition is an expression that is either TRUE (or YES) or FALSE (or NO). These values can be used interchangeably in the conditional statement. For example, the following statements can all be evaluated the same way:From <https://support.ptc.com/help/creo/creo_pma/r9.0/usascii/fundamentals/fundamentals/Conditional_Statements_in_Relations.html>
Pro/ENGINEER, Creo Elements/Pro and Creo Parametric
This is a good start but is far from comprehensive. Hopefully others will contribute to this doc to get it up to par!
These are the places I normally go:
Thank you TomUminn! I could not find this when I searched the help, searching these forums, tried navigating through the help (I didn't realize to look under fundamentals!), or opening a call/case with PTC and asking them. After not being able to find it in any of those locations (especially the TS) I thought it didn't exist. Thanks again!
Fantastic document Lawrence!
Those links do not work any more. Here is one of them and then you can jump around from there:
Does anyone know if you can put multiple lines on a single line using something like a new line or next line character?
Although this may be useful in the actual code I would really like to use it in the Evaluate Expressions dialog.
It looks like no one has answered this. For those who are familiar with the older programming language(s), what languages do you think the BOM relations follows most closely to in syntax and commands?