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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Relations in BOM

wfalco
16-Pearl

Relations in BOM

Hi,

 

I have a parameter called cage_code. I want the blank cage code in the bom column to read 96906.

 

I have another parameter called part_number. I want part_number MS51959-15's cage code to read 96906, which is currently blank.

 

I saw a tutorial on Youtube that showed the following relation that worked:

 

IF asm_mbr_part_number=="MS51957-15"
asm_cage_code="96906"
ELSE
ENDIF

This looks pretty straight forward and looks like it will work. Why does it not?

Do I need to do something to the cage code in the bom that reads &asm.mbr.cage_code? I tried something like &rel.asm.mbr.cage_code. That does not work.

 

Please help.

 

WayneF

16 REPLIES 16
StephenW
23-Emerald III
(To:wfalco)

The way I have handled this in the past is add a new repeat region relation parameter for the cage code, in my example, I use "new_cage_code".

I change the column in the table from asm.mbr.cage_code to rpt.rel.new_cage_code

 

new_cage_code=asm_mbr_cage_code

if asm_mbr_name=="MS51957-15"
new_cage_code="96906"
else
new_cage_code=asm_mbr_cage_code

endif

 

wfalco_0-1730203974034.png

 

wfalco_1-1730204032066.png

What am I doing wrong?

StephenW
23-Emerald III
(To:wfalco)

There is always something that snags these up! 

Does that part file actually have a cage_code parameter, sometimes thats the snag, and I sure don't remember how to fix that...

 

Unrelated:

Also, I noticed,  I used asm_mbr_name=="MS51957-15"  but when I looked at your setup again, you used asm_mbr_part_number=="MS51957-15"

So try changing to your relation to IF asm_mbr_part_number=="MS51957-15"

You are right. I needed to change name to part_number.

 

However - It is still not working.

 

The part does have a cage_code. But it is blank. I'm not sure if that has something to do with it.

StephenW
23-Emerald III
(To:wfalco)

Check this post https://community.ptc.com/t5/3D-Part-Assembly-Design/Repeat-Region-Relation-Blanking-Other-Cells/m-p/733329

I think you have to use the "if exists"

Silly relations will be then end of us!

 

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

 

StephenW
23-Emerald III
(To:wfalco)

And maybe a little of   this one too https://community.ptc.com/t5/3D-Part-Assembly-Design/Repeat-Region-Relation-and-Cagec-issue/m-p/739172

 

I hate repeat region relations!

Still no good. I wonder if it's cause its blank. I cant change the part file. Its locked. Relations are cool. But getting them to work is a frikin task. I wish there was a better way. Thanks for helping! I need a break. It's frustrating.

kdirth
21-Topaz I
(To:wfalco)

Below is my cheat sheet section on this.  Basically, you rename the repeat region relation and create a relation that controls the new name.

 

CHANGING ITEM IN BOM TABLE 

  1. Select “Repeat Region” from “Table” tab 
  2. Select “Switch Syms” then “Done.” 
    1. If first item cell of column to be changed starts with “rpt.rel” go to 3. 
    2. Double click on first item cell 
    3. Select rpt… then rel… then User Defined. 
      1. Type in Relation name- PRTNUM for part number/QTY for quantity/NAME for Description 
  3. Select “Repeat Region” from “Table” tab 
  4. Select “Switch Syms” 
  5. Select “Relations” then select the table. 
  6. Enter text to make change required and select OK/Done. 
    1. Part Number change: 
      • IF asm_mbr_name =="S12345_XXX" 
      • PRTNUM="S12345" 
      • ELSE 
      • PRTNUM= asm_mbr_name 
      • ENDIF 
    2. Quantity change: 
      • IF asm_mbr_name ==”S12345” 
      • QTY="XXX" 
      • ELSE 
      • QTY=rpt_qty 
      • ENDIF 
    3. Name change: 
      • IF asm_mbr_name=="SA47662" 
      • NAME="XXX" 
      • ELSE 
      • NAME=asm_mbr_name 
      • ENDIF 
  7. Select OK 
  8. Select “Update Tables” from menu then Done.  
  9. Multiple changes in a column can be done by nesting IF statements: 
    • IF asm_mbr_name =="S12345_XXX" 
    • PRTNUM="S12345" 
    • ELSE 
    • IF asm_mbr_name =="S23456_XXX" 
    • PRTNUM="S23456" 
    • ELSE 
    • PRTNUM= asm_mbr_name 
    • ENDIF 
    • ENDIF 
      • One ENDIF for each IF statement 

There is always more to learn in Creo.
wfalco
16-Pearl
(To:kdirth)

Nice!!! Thank you. I will take another stab at this in a bit. It's frustrating as heck!

MartinHanak
24-Ruby III
(To:wfalco)


@wfalco wrote:

wfalco_0-1730203974034.png

 

wfalco_1-1730204032066.png

What am I doing wrong?


Hi,

please read following information carefully.

1.]

I assume the parameter cage_code exists in all models

2.]

I assume no repeat region table cell contains &asm.mbr.cage_code

3.]

If the conditions from points 1 and 2 apply, then you need to add the parameter asm_mbr_cage_code manually in repeat region Relations dialog box. Parameter type selected is not important - Creo will change it to Unknown.

MartinHanak_0-1730275254746.png

4.]

Put &rpt.rel.new_cage_code into repeat region table cell


Martin Hanák
BenLoosli
23-Emerald II
(To:wfalco)

Why not set the cage code in that part file?

Do you have the cage_code parameter in your drawing file?

I cant change the part. I don't have permission. I am back dooring this. The drawing? I don't know how that would work.

BenLoosli
23-Emerald II
(To:wfalco)

I got this to work.

 

Drawing repeat relations are:

IF asm_mbr_pdm_number=="MS9518-01"
asm_cage_code="96906"
else
if asm_mbr_pdm_number=="MS9518-03"
asm_cage_code="96907"
else
asm_cage_code=asm_mbr_cage_code
ENDIF
endif

 

BenLoosli_0-1730224041068.png

MS9518-01 has a blank cage code, -02 has cage code 96545.

 

wfalco_0-1730225893415.png

 

BenLoosli
23-Emerald II
(To:wfalco)

You need to replace our 'pdm_number' parameter with your parameter that defines the part number to the table.

kdirth
21-Topaz I
(To:wfalco)

Try this:

Edit repeat region cell for CAGE to rpt.rel.new_cage_code.

Relation:

if asm_mbr_name==”MS51957-15”

new_cage_code=”96906”

else

new_cage_code=cage_code

endif


There is always more to learn in Creo.
Announcements
NEW Creo+ Topics: Real-time Collaboration


Top Tags