Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
OK, I will try to explain what I am endeavoring to do here.
I have bulk item that is measured in LB's, and another that is measured in Gallons.
I have created a family tabled assembly, where each instance uses a differing amounts of these bulk items
I then have a BOM Table in my drawing with a column for Unit of Measure, and another for the amounts used for each assembly item.
The challenge here is to be able to get the BOM table to show the different amounts of these bulk items, if each of the specific drawings for each instance of the family tabled assembly.
I am currently doing this as follows, and it works very well, but is rather cumbersome:
Note: This relation does control both BOM Items;
The report statement for the column is:
&rpt.rel.QUANTITY
Where "Quantity" is user defined, and is automatically created as a Repeat Region Parameter, when entered as the user defined string.
Then I entered the following Repeat Region Relation, which has to be entered with the specific quantity for weigh and volume of the two items in each assembly drawing.
IF pnreport == "PA0002"
QUANTITY = "0.00025"
ELSE
IF pnreport == "PE0003"
QUANTITY = "0.00125"
ELSE
QUANTITY= rpt_qty
ENDIF
ENDIF
What I would like to do is to add Parameters for the two items in my generic assembly model, and then family table them, which is a much simpler method of controlling these numbers.
I would then like to have the Repeat Region Relation call those parameters from the model, and display the appropriate Wight and Volume for the specific assembly in the BOM Table in its specific Drawing.
I have tried creating the parameter in both the assembly model, and in the repeat region, but that does not get it done.
I guess the question is this: Can a parameter in a Relation in a BOM Table (Repeat Region) call another parameter from the Model or not?
If I am understanding the use case correctly, I would utilize component parameters to achieve this, and then add these parameters to the family table and change them directly for each instance in the family table.
Set up your top level assembly with the two models of the bulk materials (bulk lbs, and bulk gal). Then add 2 Component parameters to each, one being the UOM = <unit of measure for that bulk item>, and the other being QTY = 0.000.
Then, in your family table, add the two component parameters for QTY as columns to be modified for table instances, and set the quantities here. For example, FT_INST_1 | QTY(bulk lbs) = .09 | QTY(bulk gal) = 2.3.
Then in your repeat region, you can call the component parameters you made with &asm.mbr.cparam.UOM and &asm.mbr.cparam.QTY, and utilize the same repeat region through your family table instances without modification, as it will update for the entered values.
"asm.mbr.cparam.QTY"
I believe that this is the key.
I know how to control these items in the assembly, thru the family table, but I just didn't know how to call a component parameter from the Repeat Region Relation.
Thanks,
I will give this a try, and post back.
BTW, these two bulk items are separate Bulk Part.
One is set already as GALS, and the other already as LBS.
The only variable item that I need to control in the Repeat Region is the actual measure.
Thanks again.
Here is what I tried, and it didn't work, so I missed something.
NOTE: I only want to vary the quantity for specific bulk items (not all bulk items) in my BOM Table.
STEP 1) I added two parameters to my assembly, one for each of the two items to be varied.
FYBERS_WEIGHT (For part number PA0002)
VULTEX_VOLUME (For part number PE0003)
STEP 2) I entered these parameters, as columns, to the family table of my assembly, then populated them with the correct amounts.
STEP 3) I set the Quantity column, of my BOM Table to RPT.REL.QUANTITY, where QUANTITY is a Userr Defined parameter.
STEP 4) I changed the relation in my BOM Table (Repeat Region) to the following:
NOTE: I only want to control the QUANTITY of a couple of items in my BOM Table, so I chose to do this thru PNREPORT which populates the part number column via RPT.PNREPORT.
IF pnreport == "PA0002"
QUANTITY = &ASM.MBR.CPARAM.FYBERS_WEIGHT
ELSE
IF pnreport == "PE0003"
QUANTITY = &ASM.MBR.CPARAM.VULTEX_VOLUME
ELSE
QUANTITY= rpt_qty
ENDIF
ENDIF
Again, ghis did not work, as both QUANTITY = &ASM...... lines have errors, but I don't know what they are.
What did I miss?
OK, here is what I tried, based on your suggestion, and it didn’t work, so I am reasonably sure that I missed something in the details.
I created the two Assembly Parameters for the two Bulk Items.
Fybers_Weight
Vultex_Gallons
I then entered the following into the Quantity Report column in the BOM Table.
&rpt.rel.QUANTITY
NOTE: (Quantity is User Defined, and was automatically created as a Repeat Region Parameter)
Finally, I entered the following relation in the Repeat Region Relations area, and it errors out, as shown below, with “_” or “.” Between the terms:
IF pnreport == "PA0002"
QUANTITY = &ASM_MBR_CPARAM_FYBERS_WEIGHT
Relation has an error
ELSE
IF pnreport == "PE0003"
QUANTITY = &ASM_MBR_CPARAM_VULTEX_VOLUME
Relation has an error
ELSE
QUANTITY= rpt_qty
ENDIF
ENDIF
If I remove the &, and enter “.” in the two line it tells me that these lines error out as shown :
ASM.MBR.CPARAM.FYBERS_WEIGHT
Invalid number in relation.
ASM.MBR.CPARAM.VULTEX_VOLUME
Invalid number in relation.
If I remove the &, and enter “_” in the two lines, the relation is accepted, but it brakes the table, in that the Part No’s in the “rpt.rel.pnreport” column disappear, and nothing is reported in the Quantity “rpt.rel.quantity” column:
ASM_MBR_CPARAM_FYBERS_WEIGHT
ASM_MBR_CPARAM_VULTEX_VOLUME
If nothing else, the "_" character can cause interpretation to be incorrect as "_" is used as a replacement for ".". Use some other character or no separator to clarify things to the relations interpreter.
I wondered about the "_" in the assembly parameters, but a dash won't work, so I changed the parameters to:
FYBERS
VULTEX
The relation is now as follows, and still breaks the table as described in my previous post.
IF pnreport == "PA0002"
QUANTITY = ASM_MBR_CPARAM_FYBERS
ELSE
IF pnreport == "PE0003"
QUANTITY = ASM_MBR_CPARAM_VULTEX
ELSE
QUANTITY= rpt_qty
ENDIF
ENDIF
So, per bquartier's suggestion, I created the required assembly parameter as a component parameter for each of the two bulk items. I then added these two component parameters as columns in the assembly family table.
I added the following relation to the BOM Table Region, and it still breaks the table as above.
IF pnreport == "PA0002"
QUANTITY = ASM_MBR_CPARAM_FYBERSWEIGHT
ELSE
IF pnreport == "PE0003"
QUANTITY = ASM_MBR_CPARAM_VULTEXVOLUME
ELSE
QUANTITY= rpt_qty
ENDIF
ENDIF
You don't need the table relations at all, that is complicating it.
Here is my process:
Create a Component Paramter (Parameters, Look in "Component", and select the component) call Quantity.
Repeat for your other bulk component, name it the same value.
In your family table, add a column, choosing Parameter, Look in Component, and choose Quantity.
Repeat for the other Quantity component parameter, so that they both are in the family table.
In the family table, you can change the values for each instance. I added a comment row so I could help distinguish from the two values.
Then in your repeat region, you can double click on the top cell to define a report parameter, or you can r.click>properties and paste the report parameter there directly.
You don't end up needing any repeat region relations - by naming the Component Parameter the same thing, the table will pick up on both in the same column, even though it means different things to different components.
I believe that I do need the Table Relation, because this is a BOM Table containing more items than just thes two bulk items.
Tthese two bulk items use "rpt.rel.quantity" for the colomn report properties, while all of the other items in the BOM Table use simple "rpt.qty".
This being the case, I have to differentiate between the two report strings.
To - bquartier
I just went through your process, and it works flawlessly for this specific action.
The problem, in this case, is that I only want to show these family tabled values for two of my bulk items.
All other items, Part and/or Bulk, need to show their regular quantities via. "rpt_qty".
So I still need the Repeat Region Relation to tell the QTY. column of my BOM Table to display this Family Tabled component parameter "quantity" for only these two items. Without the relation I get nothing at all in the QTY. column of my BOM Table, for any of the other components, and rightly so.
However, after making your process work, I realized where my problem was, and I still don't know why it didn't work.
I used unique values "qtyfybers" and "qtyvultex" for the component parameters, and then called them with "cparam" as shown below.
IF pnreport == "PA0002"
QUANTITY = asm_mbr_cparam_qtyfybers
ELSE
IF pnreport == "PE0003"
QUANTITY = asm_mbr_cparam_qtyvultex
ELSE
QUANTITY= rpt_qty
ENDIF
ENDIF
The solution was, as you suggested, to use the same parameter name “quantity” for both components, tracking them in the family table thru the comment line., and then to use this same “User Defined” parameter “quantity” in my repeat region report statement.
I did this, then wrote the relation just as above, but with "quantity" as the component parameter in both lines as shown here:
IF pnreport == "PA0002"
QUANTITY = asm_mbr_cparam_quantity
ELSE
IF pnreport == "PE0003"
QUANTITY = asm_mbr_cparam_quantity
ELSE
QUANTITY= rpt_qty
ENDIF
ENDIF
This works perfectly, and gives all the correct quantities for all components in my BOM Table.
I really would like to know why I couldn’t call the “unique” component parameter names with “cparam”, but I am glad to have this working.
Thanks for helping.
I really do appreciate it.
Roger
I really would like to know why I couldn’t call the “unique” component parameter names with “cparam”, but I am glad to have this working.
I haven't been following this thread very closely, but I'm pretty sure your relations are actually failing. Since the unique component parameter only exists for certain models, checking for it in other models will fail. To get around this use the "IF EXISTS()" function.
IF EXISTS("pnreport") IF pnreport == "PA0002" IF EXISTS("asm_mbr_cparam_qtyfybers") QUANTITY = asm_mbr_cparam_qtyfybers ELSE QUANTITY = rpt_qty ENDIF ELSE IF pnreport == "PE0003" IF EXISTS("asm_mbr_cparam_qtyvultex") QUANTITY = asm_mbr_cparam_qtyvultex ELSE QUANTITY = rpt_qty ENDIF ELSE QUANTITY= rpt_qty ENDIF ENDIF ELSE QUANTITY= rpt_qty ENDIF
If you wanted to make it a little easier to read you could even do something like this:
QUANTITY = "NOT SET" IF EXISTS("pnreport") IF pnreport == "PA0002" IF EXISTS("asm_mbr_cparam_qtyfybers") QUANTITY = asm_mbr_cparam_qtyfybers ENDIF ENDIF IF pnreport == "PE0003" IF EXISTS("asm_mbr_cparam_qtyvultex") QUANTITY = asm_mbr_cparam_qtyvultex ENDIF ENDIF ENDIF IF QUANTITY == "NOT SET" QUANTITY= rpt_qty ENDIF
By the way, if there are evaluation errors for some models, you should see the following message in the status bar:
Thank you so much Tom,
The others got me there, but with one sngle commonly named parameter, but I still prefered to use unique perameter identifiers.
Your code provided that last detail, and I can now use unique identifiable parameter names.
I started with it in its full form, and that worke just like it should.
Then I began removing the parts that I don't actuly don't need, like the "If esists pnreport" portion, because "pnreport" is an absolute constant in these BOM tables, but it is good to know how that works.
Then I cleaned up a few other lines, and ended up with the following, relatevely simple relation statement, which works like a charm.
IF pnreport == "PA0002"
IF EXISTS("asm_mbr_cparam_qtyfybers")
QUANTITY = asm_mbr_cparam_qtyfybers
ENDIF
ELSE
IF pnreport == "PE0003"
IF EXISTS("asm_mbr_cparam_qtyvultex")
QUANTITY = asm_mbr_cparam_qtyvultex
ENDIF
ELSE
QUANTITY= rpt_qty
ENDIF
ENDIF
Thanks again to all of you for all of your help.
Roger
Glad to help. I just want to point out that you might need a few additional ELSE statements.
If pnreport == "PA0002" but "QTYFYBERS" does not exist, what do you want to happen? (Right now nothing will.)
Same issue if pnreport == "PE0003" but "QTYVULTEX" does not exist. (Nothing will happen.)
You won't make it into the bottom ELSE statement since you've already successfully made it into one of the top two IF statements.
Good point.
I figured there must be a reason for those Else Statements, but it all worked.
Thanks for the heads up on the possibility of the parameter not existing, or maybe even being misstyped.
I will add them back in.
Thanks again.
You have no idea how much this helps us with these BOM's.
Roger
Here it is with those other Else statements added back in, and it is working fine.
Thanks again for the heads up.
IF pnreport == "PA0002"
IF EXISTS("asm_mbr_cparam_qtyfybers")
QUANTITY = asm_mbr_cparam_qtyfybers
ELSE
QUANTITY = rpt_qty
ENDIF
ELSE
IF pnreport == "PE0003"
IF EXISTS("asm_mbr_cparam_qtyvultex")
QUANTITY = asm_mbr_cparam_qtyvultex
ELSE
QUANTITY = rpt_qty
ENDIF
ELSE
QUANTITY= rpt_qty
ENDIF
ENDIF