BOM Table Repeat Region not functioning
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
BOM Table Repeat Region not functioning
Hello, I would like to to override a few items in a BOM table and keep all the items programed.
I have the following code entered but its not working,
I would like "XX" to be renamed to the actual part name "HEX BOLT"
Are there any specific settings I need to review?
Does the type need to be defined, if so where do I do that?
The view contains an assembly with a simplified rep.
I'm using Creo 7.0
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@RL_4555254 wrote:
Thank you!
That helps. I did not know I needed to add the original parameters
I can now get everything to load.
key point is defining the other items as well.
The if statements will work by themselves, but I cannot get multiple to work.
the syntax seams very specific with spaces and "
right now it won't accept the second endif.
it would not accept Elseif with a space "Else if"
is there a syntax guide?
Hi,
elseif is not implemented.
Use following code
if asm_mbr_name == "28632"
PRTNUM="88888"
else
if asm_mbr_name == "19451_TETHER_STRAP_MSB"
PRTNUM="19541"
else
PRTNUM=asm_mbr_name
endif
endif
Martin Hanák
- 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
Here are my cheat sheet instructions: Looks like you are missing the rename in the repeat region and the else statement.
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
Thank you for the response,
I still seem to be missing something.
I left the index alone.
The BOM is not populating after changing the parameter name, and relations won't recognize the old parameter name now.
I ensured the model/rep was selected and updated tables.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@RL_4555254 wrote:
Thank you for the response,
I still seem to be missing something.
I left the index alone.
The BOM is not populating after changing the parameter name, and relations won't recognize the old parameter name now.
I ensured the model/rep was selected and updated tables.
Hi,
please replay uploaded video. It will help you to solve your problems.
Martin Hanák
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you!
That helps. I did not know I needed to add the original parameters
I can now get everything to load.
key point is defining the other items as well.
The if statements will work by themselves, but I cannot get multiple to work.
the syntax seams very specific with spaces and "
right now it won't accept the second endif.
it would not accept Elseif with a space "Else if"
is there a syntax guide?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Also I did create separate if statements, but the last one trumps the first.
so only the last one functions and I assume you must use the elseif function.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@RL_4555254 wrote:
Thank you!
That helps. I did not know I needed to add the original parameters
I can now get everything to load.
key point is defining the other items as well.
The if statements will work by themselves, but I cannot get multiple to work.
the syntax seams very specific with spaces and "
right now it won't accept the second endif.
it would not accept Elseif with a space "Else if"
is there a syntax guide?
Hi,
elseif is not implemented.
Use following code
if asm_mbr_name == "28632"
PRTNUM="88888"
else
if asm_mbr_name == "19451_TETHER_STRAP_MSB"
PRTNUM="19541"
else
PRTNUM=asm_mbr_name
endif
endif
Martin Hanák
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Perfect!
Thank you!
This could get very large with the amount of else if I will need.
I added a 3rd one without issues.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Maybe you need to rethink some of the if clauses and move some of that information to a part parameter with a relation.
Instead of this in a repeat region:
if asm_mbr_name == "19451_TETHER_STRAP_MSB"
PRTNUM="19541"
Try this relation in the part file:
prtnum = extract(name,1,5)
This will create a parameter in your part file named prtnum with 19541 as the value. Then you can use this in the assembly BOM.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
not a part numbers will be 5 digits
if this needs to be in the .prt file I do not have modification access as it's released.
I might not be following what you are thinking, but I will say the relations are working for me now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
This is a fine way to do a few. I would look for a different solution to your problem if you have a substantial number to change. Likely easier to just manually type in a text BOM.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Agree, manual entry would be easier, but in programing there is less risk when files are update.
there are many people working on these parts and we want to ensure content/qty is accurate when something is updated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@MartinHanak wrote:
@RL_4555254 wrote:
Thank you!
That helps. I did not know I needed to add the original parameters
I can now get everything to load.
key point is defining the other items as well.
The if statements will work by themselves, but I cannot get multiple to work.
the syntax seams very specific with spaces and "
right now it won't accept the second endif.
it would not accept Elseif with a space "Else if"
is there a syntax guide?
Hi,
elseif is not implemented.
Use following code
if asm_mbr_name == "28632" PRTNUM="88888" else if asm_mbr_name == "19451_TETHER_STRAP_MSB" PRTNUM="19541" else PRTNUM=asm_mbr_name endif endif
Hi,
FYI ... you can also use the following relations, that is, don't use the else branch.
PRTNUM=asm_mbr_name
if asm_mbr_name == "28632"
PRTNUM="88888"
endif
if asm_mbr_name == "19451_TETHER_STRAP_MSB"
PRTNUM="19541"
endif
Martin Hanák
