Skip to main content
1-Visitor
March 22, 2016
Solved

How to add a Relation to BOM table to reference one parameter or another.

  • March 22, 2016
  • 6 replies
  • 6408 views

I'm generating a simple BOM table (Column headers as; Part No, Description & Quantity). The assembly comprises of components modeled by the local design team and parts from overseas. I need the table to populate the 'Description' cells (driven from a part Parameter),using either of the defined Parameters i.e 'asm_mbr_Description' or 'asm_mbr_Bezeichnung'

I believe this can be achieved by defining a Relation to the Table Repeat Region, but I am struggling to write (and apply to the table ) the correct script. This is what I've drafted:

if exists ("asm_mbr_DESCRIPTION")

bom_no=asm_mbr_description

else

bom_no=asm_mbr_bezeichnung

endif

Many Thanks.


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
Best answer by btheobald

Tom , Roger,

It works! Thanks gents for your prompt assistance.

Regards,

Bob

6 replies

23-Emerald IV
March 22, 2016

This looks okay to me...   One thing you might want to do is add an "IF EXISTS" condition fro the asm_mbr_bezeichnung as well.  Something like this:

IF EXISTS ("ASM_MBR_DESCRIPTION")

    BOM_NO = ASM_MBR_DESCRIPTION

ELSE

    IF EXISTS ("ASM_MBR_BEZEICHNUNG")

        BOM_NO = ASM_MBR_BEZEICHNUNG

    ELSE

        BOM_NO = ""

    ENDIF

ENDIF

btheobald1-VisitorAuthor
1-Visitor
March 22, 2016

Thanks for the  response Tom. however, I've revised the script in  line with your recommendations , but still cannot  get this to work in my table. Perhaps back to basics, but how  does this script get applied to the table? I feel I'm  missing a step here.

Bob

1-Visitor
March 22, 2016

Bob,

Not sure what you mean about "how does the script get applied to the table". Tom's code looks like it should work. Put the relations in the Repeat Region relations for the BOM table (Repeat Region -> Relations -> select the table). Then change the report parameter for the description column to rpt.rel.bom_no - either edit the properties and add manually "&rpt.rel.bom_no" or double click the first data row of the description column (or right click on the cell and pick Report Parameter), then use the menu picks rpt... -> rel... -> User Defined -> type in "bom_no"

-Roger