Truncating Parameter names for repeat region
Truncating Parameter names for repeat region
(OP)
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.
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.





RE: Truncating Parameter names for repeat region
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
RE: Truncating Parameter names for repeat region
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.
Thanks again.
RE: Truncating Parameter names for repeat region
-Hora
RE: Truncating Parameter names for repeat region
http://www.3dlogix.com
RE: Truncating Parameter names for repeat region
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.