Continue to Site

Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

"if" relation looking for content

mdemers

Member
Hey,
I'd like to set an "if" relation that would look like the following
IF rel_model_name == "AA"
...
but, I'd like to search for "AA" in the content instead of the complete value of rel_model_name.
In other words, I'd like the remainder of my "if" relation (not shown here) to give a "true" when rel_model_name = AA012345 and "false" when rel_model_name = 764-314, for example.
Does anyone know how to do that?
Even better : it would look for AA as the 2 first digits... but I may be dreaming here.

Regards,
Mat
 
This might be what you are looking for, it's similar to instr() function in VB







search(string, substring)

Searches for substrings. The resulting value is the position of the substring in the string (0 if not found).
Operators and Functions for Strings
The following operators and functions are supported for strings:







==

Compares strings as equal.


!=, <>, ~=

Compares strings as unequal.


+

Concatenates strings.


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.
For example:
If param = abcdef, then:
 
Grrrrreat!


Thanks a lot, it works perfectly, with "search". And I'll keep note of all the other operators too.


Mat
 
I use this all of the time. Especially handy for checking which instance of a family table is in use.



Now if PTC would add a RTOS (Real to String) function, we would be in business. Or how about some FOR loops.



Actually what I would like to see is for PTC to change Pro/PROGRAM to
accept Javascript commands. Some better scripting tools would
make Pro/E the cat's meow.



Jim
 

Sponsor

Back
Top