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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

BOM Table Repeat Region not functioning

RL_4555254
4-Participant

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

 

ACCEPTED SOLUTION

Accepted Solutions


@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?

 

RL_4555254_0-1731089849731.png

 


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

View solution in original post

13 REPLIES 13
RL_4555254
4-Participant
(To:RL_4555254)

RL_4555254_0-1731014595435.png

 

kdirth
21-Topaz I
(To:RL_4555254)

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 

  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.
RL_4555254
4-Participant
(To:kdirth)

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.  

 

RL_4555254_0-1731082219126.png

RL_4555254_1-1731082335202.png

 


@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.  

 

RL_4555254_0-1731082219126.png

RL_4555254_1-1731082335202.png

 


Hi,

please replay uploaded video. It will help you to solve your problems.


Martin Hanák

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?

 

RL_4555254_0-1731089849731.png

 

 

RL_4555254
4-Participant
(To:RL_4555254)

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.  


@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?

 

RL_4555254_0-1731089849731.png

 


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

Perfect! 

Thank you!

 

This could get very large with the amount of else if I will need.

I added a 3rd one without issues. 

BenLoosli
23-Emerald II
(To:RL_4555254)

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.

RL_4555254
4-Participant
(To:BenLoosli)

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. 

StephenW
23-Emerald III
(To:RL_4555254)

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.

RL_4555254
4-Participant
(To:StephenW)

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. 


@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?

 

RL_4555254_0-1731089849731.png

 


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
Announcements
NEW Creo+ Topics: Real-time Collaboration


Top Tags