Relations in BOM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Labels:
-
2D Drawing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
What am I doing wrong?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Select “Repeat Region” from “Table” tab
- Select “Switch Syms” then “Done.”
- If first item cell of column to be changed starts with “rpt.rel” go to 3.
- Double click on first item cell
- Select rpt… then rel… then User Defined.
- Type in Relation name- PRTNUM for part number/QTY for quantity/NAME for Description
- Select “Repeat Region” from “Table” tab
- Select “Switch Syms”
- Select “Relations” then select the table.
- Enter text to make change required and select OK/Done.
- Part Number change:
- IF asm_mbr_name =="S12345_XXX"
- PRTNUM="S12345"
- ELSE
- PRTNUM= asm_mbr_name
- ENDIF
- Quantity change:
- IF asm_mbr_name ==”S12345”
- QTY="XXX"
- ELSE
- QTY=rpt_qty
- ENDIF
- Name change:
- IF asm_mbr_name=="SA47662"
- NAME="XXX"
- ELSE
- NAME=asm_mbr_name
- ENDIF
- Part Number change:
- Select OK
- Select “Update Tables” from menu then Done.
- 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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Nice!!! Thank you. I will take another stab at this in a bit. It's frustrating as heck!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@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
Martin Hanák
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Why not set the cage code in that part file?
Do you have the cage_code parameter in your drawing file?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
You need to replace our 'pdm_number' parameter with your parameter that defines the part number to the table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
