Skip to main content
Dale_Rosema
23-Emerald III
23-Emerald III
April 16, 2012
Solved

1/2 of a part

  • April 16, 2012
  • 1 reply
  • 13590 views

We have a hardware kit that is shipped one per box of two components. We also have final drawings of the parts which have a quanitity of 0.5 for the hardware kit when just one part is shown. Using repeat regions, is there a way to have a half of a componenet in the bill of material?

Thanks, Dale


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 Patriot_1776

Put this in the cell of the column: &rpt.rel.newqty

The "rpt_qty" is in the region, it just doesn't have to be displayed. the relation will control what gets shown in the column.

1 reply

Patriot_1776
22-Sapphire II
April 16, 2012

You could add a parameter to the region, and write relations to do that parameter = rpt_qty/2 (if it worked). dunno, I never tried to split the rpt.qty in half before. You'd have to write relations to let all the other quantities stay as is, and only select certain ones to be either a value as shown above, or a manually-entered string value.

The parameter I have in my table: RPT_QTY

Model parameter: BOM_OBJECT_TYPE (integer)

The relations:

/*===================================================================

/*NOTES FOR BULK QTY "A/R" AND "REMOVED" QTY "" (NULL VALUE) PARTS BELOW:

/*

/*IF THE MODELS WERE ALL MADE WITH THE PROPER START PARTS ALL BULK ITEMS

/*WILL AUTOMATICALLY HAVE A QTY OF "A/R" (WELD FILLER, PAINT, OIL, ETC.) AND ALL

/*"REMOVED" ITEMS WILL ALL HAVE A NULL VALUE "" FOR QTY.

/*

/*THE BELOW RELATIONS AUTOMATICALLY REPLACE THE NUMERIC

/*QTY WITH EITHER "A/R" IF THE INTEGER PARAMETER "BOM_OBJECT_TYPE" IS A

/*VALUE BETWEEN 50 AND 998 INCLUSIVE, OR TO "" (NULL VALUE) IF THE VALUE IS 999.

/*

/*

/*THE BELOW RELATIONS ALSO ALLOW FOR THE MANUAL REPLACEMENT OF THE

/*NUMERIC QTY WITH EITHER "A/R" OR "" (OR ANY TEXT STRING) ON A LINE-BY-LINE

/*BASIS BY USING THE ITEM NO. (rpt_index) VALUE FOR BULK ITEMS, REMOVED ITEMS,

/*OR OTHER ITEMS. USE QTY "A/R" FOR BULK ITEMS, AND USE QTY "" FOR REMOVED

/*ITEMS. TO MAKE AN ITEM HAVE A QTY OF "A/R", SIMPLY REPLACE THE

/*ITEM NO. (0000) OF THE LINE(S) BELOW WITH THE ITEM NO. OF THE ITEM YOU WANT

/*TO CHANGE THE QUANTITY OF. THE SAME PROCEDURE APPLIES FOR THE REMOVED

/*OBJECTS. THERE ARE 1 OF EACH BELOW, AND THE "IF" THRU "ELSE" LINES CAN

/*BE COPIED AS A GROUP AS MANY TIMES AS NEEDED. ADD 1 "ENDIF" AT THE

/*BOTTOM FOR EACH ADDITIONAL COPY OF THIS 3-LINE GROUP.

/*

/*

/*AUTOMATIC BULK PART RELATIONS BELOW

IF asm_mbr_bom_object_type >= 50 & asm_mbr_bom_object_type <= 998

QTY_REQD = "A/R"

ELSE

/*

/*AUTOMATIC REMOVED PART RELATIONS BELOW

IF asm_mbr_bom_object_type == 999

QTY_REQD = ""

ELSE

/*

/*

/*MANUAL BULK PART RELATIONS BELOW

IF rpt_index == 0000

QTY_REQD = "A/R"

ELSE

/*

/*MANUAL REMOVED PART RELATIONS BELOW

IF rpt_index == 8888

QTY_REQD = ""

ELSE

/*

QTY_REQD = rpt_qty

ENDIF

ENDIF

ENDIF

ENDIF

Dale_Rosema
23-Emerald III
23-Emerald III
April 17, 2012

Frank,

Thanks for the thought.

Maybe you or others could help me trouble shoot this:

Do I put this in the window for the drawing under Tools: Relations?

This is the error message I am getting:

if asm.mbr.pn = 9117

error Invalid number in relation.

qty_reqd=rpt_qty/2

else

if asm.mbr.pn = 9556

error Invalid number in relation.

qty_reqd=rpt_qty/2

else

qty_reqd=rpt_qty

error Invalid symbol 'rpt_qty' found.

endif

endif

13-Aquamarine
April 17, 2012

Hi Dale...

You need to do a couple of things. First, your repeat region is likely using the system default report parameter &rpt.qty to drive the quantity column. To override this column, you need to use your own parameter. You can't override the system default quantity parameter... you must use a replacement.

Second, you need to add some Table Relations as Frank has suggested. You do not add these like normal relations. You can go to the relations window and select Table as the type (and then pick the BOM) to "place" them in the BOM table. But the preferred method to enter table relations is to go to Table->Repeat Region->Relations and then pick the BOM. A relations editor will pop open. Inside that editor, enter the following:

if asm_mbr_pn == "9556"

newqty = "0.5"

else

newqty = rpt_qty

endif

This assumes you have a parameter called "pn" in all your models. As each model in the BOM is evaluated, the value of "pn" is examined. If "pn" is set to "9556" then a new variable called newqty is set to "0.5". Otherwise this new variable called newqty is set to the system default quantity parameter.

Note that "." is not used in table relation although they are used everywhere else. Table relations have some weird idiosyncrasies that make them tricky for those who are new at using them. In table relations, the "." is replaced by an "_" underscore. Whenever I make new variables in a table relation, I always keep them to a single word. For instance, I could have called the new variable new_qty but I prefer not to introduce additional underscores. I've seen these additional underscores cause conflicts so I prefer to stick to a single word variable name.

The final piece to the puzzle is to go back and replace the system default quantity parameter with the new custom one you created in the table relation. The format for this is &rpt.rel.<user parameter name> .

So... your BOM should contain the relations above... and the quantity column should use the parameter &rpt.rel.newqty to report the quantity. Update the table once you've replaced the parameter. The table should look normal except you should now see "0.5" in the quantity column next to 9556.

Hope that made sense... give it a try and let us know if you get stuck.

Thanks!

-Brian