Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

BOM Relations

Status
Not open for further replies.

delia0027

Mechanical
Feb 26, 2014
6
Okay, I've been going at this for hours now and I’m having no luck. Hopefully someone on here has had a similar issue and can help…

[Background Info]
We add “_bulk” to bulk item part numbers to differentiate them from actual parts.
For example, if we have part number “AB1234” the bulk item version of this (if necessary) is “AB1234_BULK”

[Issue]
The issue is when populating the BOM, “AB1234_BULK” appears as the part number (asm.mbr.name) for the bulk items and we only want it to display “AB1234”.

I created a relation in the bulk part itself which creates a parameter that truncates anything containing “_bulk”. So, out of the box, the bulk item “AB1234_BULK” contains a parameter named “bulkname” that automatically generates the value “AB1234”.

Next, in the assembly BOM relations, I simply want to write a relation that replaces “asm_mbr_name” with “asm_mbr_bulkname” whenever it sees “_bulk” as a value. Is this possible?

Currently, my BOM relations are as follows:

if asm_mbr_name=="_bulk"
asm_mbr_name=asm_mbr_bulkname
else
asm_mbr_name=asm_mbr_name
endif

But, I get absolutely no change to the BOM when doing this, or when trying anything for that matter... it just stays the same as if I did nothing.
Is there a symbol for “contains” as opposed to “equal to”?
How would I go about this?

I am a novice at relations so the more in layman's terms he better.
Thanks in advance.
 
Replies continue below

Recommended for you

You are looking for a name that equals '_bulk' when you need to be looking for a substring of name that contains '_bulk'.

slen=string_length(asm_mbr_name)
if extract(asm_mbr_name,slen-5,slen)=="_bulk"
asm_mbr_name=asm_mbr_bulkname
else
asm_mbr_name=asm_mbr_name
endif



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

Ben Loosli
 
I tried this but it doesn't seem to do anything.
It comes up with "Probable error in function evaluation"

Can you explain to me what the -5 means in the code? I don't get what line 2 is actually saying.
 
Okay here's what I ended up doing with the BOM relations and it seems to work... I added a column to the BOM table, asm_mbr_type and used the following relation:

IF asm_mbr_type=="BULK ITEM"
pnreport=asm_mbr_bulkname
ELSE
pnreport=asm_mbr_name
ENDIF

and then I deleted the asm_mbr_type column from the BOM table and it seems to work out. Will this hold?

Now, my new problem is this in the actual bulk item relations...
We have some bulk items that are the regular part number, for example, "AB1234", and some that have the suffix "_bulk" added, example, "AB1234_BULK".
I didn't realize this before but by adding the relation that generates the parameter "bulkname" in the bulk part, it only works for the items that have the "_bulk".
For instance, my current relation in the bulk items is this....

bulkname = extract(rel_model_name,1, (search(rel_model_name, "_")-1))

So, for example, bulk item part number "AB1234_BULK" with the above relation will produce a parameter named "bulkname" with the value of "AB1234". This did exactly what I wanted it to do so I can use this "bulkname" parameter in the assembly BOM relations.
The problem is, this same relation added to bulk item part number "AB1234" will produce the same "bulkname" parameter with an empty value, thus producing an empty field in the assembly BOM table.

I feel like there has to be a fairly easy way to write a relation to make the "bulkname" parameter report "AB1234" regardless if the model name is AB1234 or AB1234_BULK, I just don't know how to do it... but I feel like the relation you wrote in your reply was similar to what I would need to do... I just cannot figure it out.
 
Find the length of the asm_mbr_name string
slen=string_length(asm_mbr_name)
If the part name is abc12345_bulk then slen will equal 12

Determine if the part name ends in '_bulk'
if extract(asm_mbr_name,slen-5,5)=="_bulk"
Compare the last 5 characters of the asm_mbr_name string to see if they equal '_bulk'
Extract takes a string (asm_mbr_name) and pulls out charcaters specified by a starting point (slen-5) and the number of characters you want.
The 5 comes from the length of the string we want to find (_bulk) which we need to subtract from the full string length (slen).

I had a mistake in my original post. See the IF line in my explaination above for the proper format.


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

Ben Loosli
 
What we do is to have a separate parameter called model_name. In our standard parts and start part, there is a relation model_name=rel_model_name. For your bulk items, you can have the relation you use above.
Then in the BOM, you use the model_name parameter - this format works for multiple applications, because it is BOM independant.
 
We don't identify bulk items with a special part name so they just go in.


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

Ben Loosli
 
Thanks for all the help everyone.

What I ended up doing was using a user defined report symbol in the BOM part number column (rpt.rel.pnreport) as opposed to the standard asm.mbr.name.
From here, I created a relation in the repeat region as follows:

pnreport=extract(asm_mbr_name,1,6)

This basically cuts all part numbers down to only show the first through sixth character, which solves the problem for us here as all of our part numbers are 6 characters.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor