×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Set custom Index values in repeat Region

Set custom Index values in repeat Region

Set custom Index values in repeat Region

(OP)
Good morning,

I'm wondering if there is a way to set custom values for the Index numbers in a repeat region? As it sits, Index value starts at 1, 2, 3 etc. Can I set it to 001,002,003 etc?


Thanks for your help!

RE: Set custom Index values in repeat Region

You can create a parameter that takes the index and prefixes it with the desired leading characters and then have the balloon symbols use that parameter as their repeat region index symbol.

RE: Set custom Index values in repeat Region

(OP)
Thanks for your response @3DDave! Could you give me a brief explanation on how to go about that? I'm fairly new to Creo, I've only been using it for about 3 months. I appreciate the help!

RE: Set custom Index values in repeat Region

It would involve 2 things. The first would be a new parameter for the index column and use in your balloons. The second is to write a repeat region relation that adds the prefix characters to the system index parameter and assigns it to you new parameter. You cannot just add '00' in front of all indexes as that would lead to 009 and then 0010 when you probably want 010. There is a good explanation of relations in the help documentation, as well as repeat region parameters.

"Wildfires are dangerous, hard to control, and economically catastrophic."

Ben Loosli

RE: Set custom Index values in repeat Region

(OP)
Thanks @looslib, I'll dig through the help documentation and see what I can figure out!

RE: Set custom Index values in repeat Region

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 https://support.ptc.com/help/creo/creo_pma/r7.0/us...

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 https://support.ptc.com/help/creo/creo_pma/r7.0/us... which is where relations are added. You'll need to read the section on relations. PTC provides an example: https://support.ptc.com/help/creo/creo_pma/r7.0/us...

Notice the menu sequence "rpt > rel > User Defined" to create your new parameter.

An example of using relations:

Quote (creo)


see Pro Engineer - Relation Operators and Functions for Strings for syntax on extract() and search()

Simplified for readability, base on from http://communities.ptc.com/message/240198#240198 (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:

Quote (creo)


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 https://support.ptc.com/help/creo/creo_pma/r7.0/us... for information on changing the index value that balloons use.

RE: Set custom Index values in repeat Region

(OP)
Wow! Thank you so much @3DDave! That is extremely helpful, I think I'll be able to sort it out from the help you've provided. I was playing around with it but I didn't have the correct operators/syntax for strings. This makes it much easier to sift through, thanks again!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Resources

Low-Volume Rapid Injection Molding With 3D Printed Molds
Learn methods and guidelines for using stereolithography (SLA) 3D printed molds in the injection molding process to lower costs and lead time. Discover how this hybrid manufacturing process enables on-demand mold fabrication to quickly produce small batches of thermoplastic parts. Download Now
Design for Additive Manufacturing (DfAM)
Examine how the principles of DfAM upend many of the long-standing rules around manufacturability - allowing engineers and designers to place a part’s function at the center of their design considerations. Download Now
Taking Control of Engineering Documents
This ebook covers tips for creating and managing workflows, security best practices and protection of intellectual property, Cloud vs. on-premise software solutions, CAD file management, compliance, and more. Download Now

Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close