Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bulk Item Quantity Repeat Region Relation - Creo 5.0

Status
Not open for further replies.

MannyV

Mechanical
Jun 28, 2021
4
Hi,

I am new to this forum and this is my first post. Please go easy on me. [glasses]

I'm trying to place "AR" to several items in my BOM table. I have been successful placing "AR" in one of the items, but I can't seem to put "AR" in the other items.

BOM_relations_qk0tc5.png


I've typed in the relations editors several combinations, but with no success. I've used the following:

IF asm_mbr_part_number == "EA E-00NS"
This part number worked in my BOM table, & shows "AR". How can I add the following part numbers, "8117A25" and "93725K76", to the editor so that these PNs show "AR" as well.

Thanks!

MannyV
 
Replies continue below

Recommended for you

The simple way is to use
ELSE IF asm_mbr_part_number == "****"
QTY1 = "A/R"
ELSE IF asm_mbr_part_number == "****"
QTY1 = "A/R"

for as many items (filling the "****" as required) as you have.

Alternatively, if the parts have some part parameter that indicates it is bulk material, use that.

I think it would be asm_mbr_part_param; something like that. It's been a while and I am missing my reference, but if you use the relation editor you can walk through to get the syntax from that.

I expect you need to use

IF exists(asm_mbr_part_param)
IF asm_mbr_part_param_bulk == True (or "Yes", if a string was used rather than boolean)
QTY1 = "A/R"
ELSE
QTY1 = rpt_qty
ENDIF
ENDIF

The exists() function is used to avoid failing for parts that don't have "bulk" (or whatever name you choose) as a parameter. The Repeat Regions fail silently rather than popping up error messages, so it may not be required, but I think if it is allowed in Repeat Region Relations that "exists()" is a good test. I'm 99.9% sure it's acceptable there. I believe I have used it to build tables to determine which parts are missing parameters.
 
I did find the following in my notes:

For example, let's say you have the following parameters set inside your 3D models (accessed by going into Tools>Parameters):
Description = "Bushing, Size #2, Stainless Steel, #150"
Part_Number = "123456-111"
Designers_Name = "Martin"
To access these parameters in your BOM, you'd use the parameters:
asm.mbr.description
asm.mbr.part_number
asm.mbr.designers_name

Apparently for "==" and "!=" one can also use "\*" as part of the string as a wildcard. It may not work for "<" and ">" evaluations.
 
Thanks for your reply...

Here's what happens when I try to add the other part numbers..

Error_Message_Relations_rmzgq8.png


I followed what's in a Pro/E User's guide...

IMG_4792_r6kkxl.jpg

IMG_4791_c0j4ct.jpg


And yes..these parts are "bulk" items, but they are actual models of bulk items that I modeled so that it shows up in my drawing. The only time I use "bulk" item is glues, adhesives, etc...

I've also tried to add each part separately in the editor.
IF asm_mbr_part_number == "9402T61"
IF asm_mbr_part_number == "8117A25"
IF asm_mbr_part_number == "93725K76"
I get the same error message...
 
That's why I said use ELSE IF.

You cannot use a comma separated list and cannot use sequential IF statements without matching ENDIF for each one in the relations.

The section showing the comma separation is for "By Rule" in the FILTER section, not in the RELATION section.

The Relations are a separate programming language; the filters are directives. It's a subtle difference that PTC might have done better to improve - the writer of that book did not do a good job.
 
If these parts were true bulk items, you could use the parameter asm.mbr.type == "BULK" as a filter.

Since you have created actual parts, I would add a YES/NO parameter to each 'bulk' part, and use that as a filter for the relations.
 
Thanks for your replies!

Finally, figured it out...

I nested all the IF statements together, and it finally worked!

BOM_Bulk_relations_wkmvqb.jpg


I did put the ENDIF statement after each "QTY = rpt_qty" statement, but it didn't work. Then I placed the three ENDIF statements at the end, & it worked!

Thank you!

MannyV
 
The easy way if they are all bulk items:

IF asm_mbr_type == "BULK ITEM"
quantity = "AR"
ELSE
quantity = rpt_qty
ENDIF

I have this in my start template BOM table for all drawings.
Nothing to edit later.

"Wildfires are dangerous, hard to control, and economically catastrophic."

Ben Loosli
 
Instead of the nested IF-ElSE, you could do:

If asm_mbr_part_number == "93725K76"|"8117A25"|"9402T61"
QTY1 = "AR"
ENDIF

The | is an OR operator.
There is a limitation of 80 characters in a line.

"Wildfires are dangerous, hard to control, and economically catastrophic."

Ben Loosli
 
Thanks Ben...I'll keep in mind next time!

Stay safe!

MannyV
 
Interesting - never seen an OR statement work like that. Usually it's limited to bit-wise combinations of integers or boolean variables.

I've seen the "&" operator used for concatenation, but not "|" for strings?

C and Python use OR operator on strings as if they are FALSE if they are null/empty.

I could expect it to be used as a match in the filter section directives.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor