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

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

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

btheobald
1-Newbie

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

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.
1 ACCEPTED SOLUTION

Accepted Solutions
btheobald
1-Newbie
(To:TomU)

Tom , Roger,

It works! Thanks gents for your prompt assistance.

Regards,

Bob

View solution in original post

6 REPLIES 6
TomU
23-Emerald IV
(To:btheobald)

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

btheobald
1-Newbie
(To:TomU)

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

rcook
6-Contributor
(To:btheobald)

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

TomU
23-Emerald IV
(To:btheobald)

Essentially the relations statement is evaluated once for each unique row in the table.  It's like you opened each model and manually copied this relations statement into it, except in this case, the resulting parameter only exists in the repeat region table.

It will probably help for testing to have one column in your table for each of the three parameters, "ASM_MBR_DESCRIPTION", "ASM_MBR_BEZEICHNUNG", and "BOM_NO".

Just to be clear, the table parameter would be entered this way:  &rpt.rel.BOM_NO

btheobald
1-Newbie
(To:TomU)

Tom , Roger,

It works! Thanks gents for your prompt assistance.

Regards,

Bob

Dale_Rosema
23-Emerald III
(To:btheobald)

Don't forget to mark the appropriate answer correct. (For those who may find this post in the future.)

Top Tags