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

Extract information from a parameter in schematics

Regular Member

Extract information from a parameter in schematics

Hi.
I'm currently struggling with with a use case in Creo Schematics that hopefully a more experienced user can help me with.

 

I want to extract part of the fiber name into a new parameter of the fiber (e.g. Signal).

Let me explain: If the fiber uses the name format W## (Name e.g. W03) then I want to calculate the value of another parameter that calculate and extracts the number from the name.

 

Example 1:

Name = W03

Signal = 03 (calculated = yes)

 

Example 2:

Name = W10

Signal = 10 (calculated = yes)

 

I'm not sure if this makes any sense.

I assume that Java needs to be involved somehow but thats not my area och expertise.

 

BR Jonas Fransson

2 REPLIES 2

Re: Extract information from a parameter in schematics

I'd take a look at the ArtifactName.slice function. It's an existing java function available in Creo Schematics and lets you slice part of the name either from a character or for a number of characters from the start/end.

Re: Extract information from a parameter in schematics

Thank you very much.

I might be wrong but from what I understand when I read about this the function is only available for labels? I need a parameter to use a similar function as {ArtifactName.slice(2,3)} or {ArtifactName.slice(-02)} but is must be a part of the name in order to be correctly reported to Creo Parametric.