Skip to main content
1-Visitor
August 16, 2013
Question

Table Relations - Search Function

  • August 16, 2013
  • 1 reply
  • 7537 views

Pro/E WF4.0 M220

Syntax:

IF search(ASM_MBR_PARAMETER,"string")>0

statement

ENDIF

Error:

Invalid data type combination at left side of expression

As far as I can tell, this is a limitation of Pro/E (or at least the build I am using). The parameter is a string and I can use the extract function, but any search function using a parameter as the argument always returns an errror. Any help would be greatly appreciated!


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.

1 reply

1-Visitor
August 17, 2013

Try the following syntax:

SEARCH_PARAM=search(asm_mbr_user_parameter,"string")

IF SEARCH_PARAM>0

statement

ELSE

statement otherwise

ENDIF

The first line of the code, the assign operation, cannot be declared upfront somewhere in the top of the relations. This is important, You should define this kind of assign operation right before the if statement where you use the conditional with the parameter that comes from this assign operation, else you might get the same error you get above.

In report table relations, conditional operators such as <, >, ==, <> cannot be used along with system parameters such as asm_mbr_name, asm_mbr_type, etc. You have to first make a copy of those by assigning them to another param.

Make sure you only work with one system parameter such as asm_mbr_name at a time, and then close it with ENDIF before working with another. IF statements can be stacked one into another, but I doubt stacked IFs will ever work with conditional operators as said above.

1-Visitor
August 19, 2013

Thank you for the help Jakub.

I had tried declaring a separate integer parameter as the result of a search function prior to posting without success. After reading your post I attempted assigning a parameter again hoping that I had just made a syntax error the first time.

Unfortunately, I still receive the same error message (indication that ASM_MBR_PARAMETER, which is a string, is not a compatible data type for the search function). Even defining a string parameter within the repeat region relations that is equal to the ASM_MBR_PARAMETER and attempting to search the new table parameter results in an error.

I am starting to believe that searching a string parameter is not possible in table relations.

1-Visitor
August 19, 2013

It is possible. I do have a relation to find underscorer in the asm_mbr_name parameter in my repeat region relations.

This relation works on Creo Parametric 2.0 M020, but not on M030, M040, M050, M060 because it is bugged there. It's supposed to be fixed in Creo Parametric 2.0 M070.

This same bug happened to be in some of the Wildfire 4 subversions, which goes about 7 years back, but it was propably resolved back then. I'd think it was resolved in the latest WF4 subversions which i guess is M220. It has just leaked in Creo 2.0 M030 somehow.

I do have WF4 M220 at work, but I can't even figure out how to add a model to a drawing there. It's just so different compared to Creo 2.0.

If you can build some dummy assembly with a dummy assembly drawing to test this issue then maybe I can help you out. It really shouldn't be that hard.