Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Truncating Parameter names for repeat region

Status
Not open for further replies.

beljunk

Mechanical
Nov 8, 2002
2
Hi All,

I'm trying to truncate the model names in the repeat region of the parts list.
Ex.

asm_mbr_name = 1234-123456_description
asm_mbr_name = 123456_description
asm_mbr_name = 12abc_description_desc2


what I want in the assembly drawing bom is:

1234-123456
123456
12abc

any help would be greatly appreciated.
 
Replies continue below

Recommended for you

Hi,

I see that you want to eliminate all charachters after "_" for all your parts. Follow me:

In each part, cretate a new parameter "model_name" and add the following relation:

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

Then in BOM replace &ASM.MBR.NAME with &ASM.MBR.MODEL_NAME

PRO/E will display in the BOM table the names you desire.

Good luck.

-Hora
 
Hi Hora,

Thanks for the info. I tried something similar to this but slightly different.
However, I'm trying to do this at the assembly drawing level but within the repeat relations. There are tens of thousands of parts that currently exist within the database. I don't have the rights or privileges to change these parts. Many different engineers and designers over the years have named their parts differently and with different parameters.

So with that said, is there any way of getting the assembly BOM to truncate the assembly member name?

I could use the following:

if asm_mbr_name=="12345_ABCDE"
asm_mbr_part_number="12345"
else
asm_mbr_part_number=asm_mbr_name
endif

I just don't want to have to do this for every part in the BOM. I have tried:
asm_mbr_part_number = extract(asm_mbr_name,1, (search(asm_mbr_name, "_")-1))
And I get the good old: /* ERROR: Relation has an error.

There has to be a way. [ponder]

Thanks again.
 
I did a half of your problem. I was able to list in BOM the a string of characters representing a part number like "12345". Unfortunately, Pro/E cannot apply "search" function on ASM_MBR_NAME, so you cannot detect automatic the first "_" character (that was the clue of the problem). Probably because ASM_MBR_NAME is a type of wide string? I have no ideea at this moment. I will search other work-arrounds and if I'll find the solution I will summit it.

-Hora
 
You should apply a similar relation to the BoM table in the drawing, and not the assembly. This way, when the table is made, you dont need to stick this relation in every part, just the table cells.
 
Hi Steve,

The problem is that when you apply my relation to the BOM repeat region in this way (of course, putting the &rpt.rel.bom_name in repeat region cell instead of &asm.mbr.name):

BOM_NAME = extract(asm_mbr_name,1, (search(asm_mbr_name, "_")-1))

the program returns an error message. The error comes from this portion of the relation:

....search(asm_mbr_name, "_")

The return of the search function is a real number and it takes two strings as input. But I think that "asm_mbr_name" is not a string. Probably is a wide string and we have no function to convert it to a "normal" string outside Pro/Toolkit. I'm not sure, but for the moment I cannot see what is wrong.

-Hora.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor