Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
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
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
What am I doing wrong?
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.
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
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.
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
Nice!!! Thank you. I will take another stab at this in a bit. It's frustrating as heck!
@wfalco wrote:
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.
4.]
Put &rpt.rel.new_cage_code into repeat region table cell
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.
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
MS9518-01 has a blank cage code, -02 has cage code 96545.
You need to replace our 'pdm_number' parameter with your parameter that defines the part number to the table.
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