Skip to main content
1-Visitor
May 26, 2015
Question

Relation in Repeat Region

  • May 26, 2015
  • 5 replies
  • 1880 views

Hello,

I would like to know how one can use OR into repeat region relation.

My scenario is as below:

If PartName = "001" or Param1= "001_Updated"

/*Do something

end if

Regards

Ketan


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.

5 replies

1-Visitor
May 26, 2015

If you have OR you can do like this:

If PartName = "001"

/*Do something

end if

If Param1= "001_Updated"

/*Do something

end if

1-Visitor
May 29, 2015

If CREO has no "OR", you can use a variable as a way around it.

i = 0;

if i=0

     if partname = "001"

          /*Do

          /*i=1

     end if

end if

if i=0

     if partname = "001_v2"

          /*Do

          /*i=1

     end if

end if

This way, in case you have both, it won't do the same action twice.

12-Amethyst
May 29, 2015

There is an ELSE function that may work.

I haven't tried this, so it may need to be tinkered with:

IF PartName = "001"

/*Do Something

ELSE

IF Param = "001_Updated"

/*Do Something

ENDIF

ENDIF

1-Visitor
May 29, 2015

Hi,

I need to do same thing for PartName as 001 and 001_Updated both... Else condition will not work as repetition will happen. In addition to that, I do have scenarios of 002 and 002_Updated and so on as well....

Regards

Ketan

1-Visitor
May 29, 2015

Use the "|" to represent the OR function. "&" is for AND.

23-Emerald IV
May 29, 2015

Creo relations, including repeat region relations, uses the ampersand (&) for AND and the pipe (|) for OR.

IF PartName == "001" | Param1 == "001_Updated"

    /* Do something

ENDIF

23-Emerald IV
May 29, 2015

Sorry David.  Your post wasn't visible when I was replying.  Hopefully the forum bug isn't back.