Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
I have a guy that’s playing around with adding some new parameters to COTS parts to have the BOM table display different parameters for those specific parts.
I have the BOM table relations displaying the results the way he wants them, but not using the logic he wants. He wants to use a YES NO parameter to determine what gets displayed in the BOM table.
I just can’t get that to work. And yes all the parameters displayed and not displayed in the table are in the Local Parameters when editing the table relations, so that’s not the issue.
Here is what works:
This displays both the normal parts without the added COTS parameters and the COTS parts
/* RELATIONS FOR PART NO COLUMN
new_part_no="MISSING PARAMETER"
if exists("asm_mbr_bom_part_no")
new_part_no=asm_mbr_bom_part_no
endif
if exists("asm_mbr_part_number")
new_part_no=asm_mbr_part_number
endif
if exists("asm_mbr_vendor_part_no")
new_part_no=asm_mbr_vendor_part_no
endif
What he wants the logic to look like is something like this:
This will not display the part number for the normal parts that don’t have the COTS Yes/No parameter.
/* RELATIONS FOR PART NO COLUMN
new_part_no="MISSING PARAMETER"
if exists("asm_mbr_bom_part_no")
new_part_no=asm_mbr_bom_part_no
endif
if exists("asm_mbr_part_number")
new_part_no=asm_mbr_part_number
endif
IF asm_mbr_cots == "YES"
new_part_no=asm_mbr_vendor_part_no
endif
What he actually sent me was this:
This will not display any field other than the item number for the non-COTS part.
IF asm_mbr_cots == "YES"
new_part_no=asm_mbr_vendor_part_no
ELSE
if exists("asm_mbr_bom_part_no")
new_part_no=asm_mbr_bom_part_no
endif
ENDIF
Can you upload a sample file with parts?
Hi,
I am not sure whether I understand your description well, therefore I only guess that, when the condition in 1st IF command is TRUE then you want to skip 2nd and 3rd IF command. I suggest you to use following relations:
/* RELATIONS FOR PART NO COLUMN
new_part_no="MISSING PARAMETER"
new_part_no_set=0
IF exists("asm_mbr_bom_part_no")
new_part_no=asm_mbr_bom_part_no
new_part_no_set=1
ENDIF
IF new_part_no_set==0 & exists("asm_mbr_part_number")
new_part_no=asm_mbr_part_number
new_part_no_set=1
ENDIF
IF new_part_no_set==0 & asm_mbr_cots == "YES"
new_part_no=asm_mbr_vendor_part_no
new_part_no_set=1
ENDIF