I can't give a step-by-step. It's been a while and I don't have access to the software anymore. I can tell where to look, I think.
Start at
Note the "rpt.index" which is the name of the repeat region index. This is a defined item that internally numbers each line of the repeat region.
Then look at
which is where relations are added. You'll need to read the section on relations. PTC provides an example:
Notice the menu sequence "rpt > rel > User Defined" to create your new parameter.
An example of using relations:
creo said:
see Pro Engineer - Relation Operators and Functions for Strings for syntax on extract() and search()
Simplified for readability, base on from
(external link), which follows this.
/***************************************************************************************************
NAME = FILE_NAME
OLD = "_"
NEW = " "
if Search(NAME, OLD)!=0
NAME=extract(NAME,1,Search(NAME, OLD)-1)+NEW+extract(NAME,Search(NAME, OLD)+1,String_length(NAME)-Search(NAME, OLD))
if Search(NAME, OLD)!=0
NAME=extract(NAME,1,Search(NAME, OLD)-1)+NEW+extract(NAME,Search(NAME, OLD)+1,String_length(NAME)-Search(NAME, OLD))
if Search(NAME, OLD)!=0
NAME=extract(NAME,1,Search(NAME, OLD)-1)+NEW+extract(NAME,Search(NAME, OLD)+1,String_length(NAME)-Search(NAME, OLD))
endif
endif
endif
I doubt the ptc community link works. PTC breaks their user community forum too often.
The following operators and functions are supported for strings:
== Compares strings as equal.
!=, <>, ~= Compares strings as unequal.
+ Concatenates strings.
string_length(parameter name) returns the length in characters of the string contained by parameter name
itos(int) Converts integers to strings. Here, int can be a number or an expression. Non-integers are rounded off.
search(string, substring) Searches for substrings. The resulting value is the position of the substring in the string (0 if not found).
extract(string, position, length) Extracts pieces of strings.
Probable error in function evaluation - This message is given when the EXTRACT function is used in Relations when the parameter length is greater as the parameter name to be extracted.
For example:
If param = "abcdef", then:
flag = param == "abcdef"—returns TRUE
flag = abcdef != "ghi"—returns TRUE
new = param + "ghi"—new is abcdefghi
new = itos(10 + 7)—new is 17
new = param + itos(1.5)—new is abcdef2
where = search(param, "bcd")—where is 2
where = search(param, "bce")—where is 0
new = extract(param,2,3)—new is bcd
Note: If you use the itos function on a parameter whose value is zero (0), the return value is an empty string.
The following examples illustrate the itos function:
creo said:
integer_param = 4
string_param = itos(integer_param)
/*string_param will return 4 */
integer_param = -7
string_param = itos(integer_param)
/*string_param will return -7 */
For an integer with zero (0) value, the itos function returns a null ("") value as shown below:
integer_param = 0
string_param = itos(integer_param)
/*string_param will return an empty or null string ("") */
To return a zero string value ("0"), use the following IF statement:
integer_param = 0
string_param = itos(integer_param)
IF string_param == ""
string_param = "0"
ENDIF
Finally, see
for information on changing the index value that balloons use.