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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Repeat Region Relation and Cagec issue

kspabs
7-Bedrock

Repeat Region Relation and Cagec issue

I have the following relation in my relations for a BOM that simply removes the specified cage code:

 

 

IF exists("asm_mbr_cagecode") 
	IF asm_mbr_cagecode == "12345"
	my_cagecode = " "
	ELSE
	my_cagecode = asm_mbr_cagecode
	ENDIF
ENDIF

 

 

 Which has worked as intended, EXCEPT I am now noticing that there are a few parts in my BOM that are pulling the incorrect cage code from another unrelated part. Without the relation, I don't have this issue. Not sure where this issues may be coming from.

ACCEPTED SOLUTION

Accepted Solutions
TomU
23-Emerald IV
(To:kspabs)

Makes sense.  "my_cagecode" is a repeat region level parameter and it's value is static unless something changes it.  When "asm_mbr_cagecode" doesn't exist, there is nothing to change "my_cagecode" to some other value.  You need to either pre-initialize "my_cagecode" or add an extra ELSE statement.

 

my_cagecode = " "

IF exists("asm_mbr_cagecode") 
    IF asm_mbr_cagecode == "12345"
	    my_cagecode = " "
    ELSE
	    my_cagecode = asm_mbr_cagecode
    ENDIF
ELSE
    my_cagecode = " "
ENDIF

View solution in original post

2 REPLIES 2
TomU
23-Emerald IV
(To:kspabs)

Makes sense.  "my_cagecode" is a repeat region level parameter and it's value is static unless something changes it.  When "asm_mbr_cagecode" doesn't exist, there is nothing to change "my_cagecode" to some other value.  You need to either pre-initialize "my_cagecode" or add an extra ELSE statement.

 

my_cagecode = " "

IF exists("asm_mbr_cagecode") 
    IF asm_mbr_cagecode == "12345"
	    my_cagecode = " "
    ELSE
	    my_cagecode = asm_mbr_cagecode
    ENDIF
ELSE
    my_cagecode = " "
ENDIF
kspabs
7-Bedrock
(To:TomU)

Awesome, this fixed it exactly and makes sense why I was seeing this behavior. Thank you!

Announcements
NEW Creo+ Topics: Real-time Collaboration


Top Tags