cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Custom symbol (text) with qutomatic Qty.

pkumar-6
1-Newbie

Custom symbol (text) with qutomatic Qty.

Hi all,

Im looking for the solution as noted below,

Right now im using a custom symbol (which was developed long ago) showing part name & qty. But i need to manually entering / editing the part name and qty. After a long search, now im using "&model_name" in the part name field. Its now showing the actual part name like PAD_SUPPORT_1. Is there a way to exclude the "_"?

Secondly please help me to add the qty automatically. I tried to enter &rpt.qty in the QTY field. But its not working. consider im trying this in a drawing for an assy which is having 6 different parts.

Im using WF4.0

Thanks in advance.


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
3 REPLIES 3

Pradeep,

to remove "_" character, you have to create relation defining new parameter, eg. MY_MODEL_NAME. You can find "_" character using search(string, substring) function. You can extract part of model name using extract(string, position, length) function. You can join several text strings using + operator.

rpt.qty parameter is related to repeat region. You can use it in repeat region tables and in repeat region BOM balloons.

Martin Hanak


Martin Hanák
Chris3
20-Turquoise
(To:pkumar-6)

From Document - CS58396 (requires login)

https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS58396

This is written for repeat regions, but it will also work in the part relations if you aren't using a repeat region. Just use rel_model_name instead of asm_mbr_name. As to the quantity, if you are working on QTYs for components in an assembly, what Martin mentioned will work. If you are just working on a component though, there is no way for the component to know how many times its used. It can not be automated. There is no way for the component to know that it is being used in an assembly on your computer but then also separately in another assembly on someone else's computer.

  • Users may use the below given example relations to replace "_" in part names displayed in repeat region tables.
  • Note:- bom_name is a user defined repeat region local parameter

Users may use the below given example relations to replace "_" in part names displayed in repeat region tables.

Note:- bom_name is a user defined repeat region local parameter

if asm_mbr_name != "NULL"

/* Identify the location of the underscore

pointer1= search(asm_mbr_name,"_")

/* Verify if the underscore exists

IF pointer1 == 0

/* If it does not, name should not change

BOM_NAME = asm_mbr_name

ELSE

/* if the underscore does exist, assign the length of the name

/* minus the underscore to param index

segment_1=pointer1-1

segment1=extract(asm_mbr_name,1,segment_1)

length=string_length(asm_mbr_name)-pointer1

segment_2=pointer1+1

segment2=extract(asm_mbr_name,segment_2,length)

pointer2=search(segment2,"_")

IF pointer2 == 0

BOM_NAME=segment1+" "+segment2

ELSE

segment_3=pointer2-1

segment3=extract(segment2,1,segment_3)

length2=string_length(segment2)-pointer2

segment_4=pointer2+1

segment4=extract(segment2,segment_4,length2)

pointer3=search(segment4,"_")

IF pointer3 ==0

BOM_NAME=segment1+" "+segment3+" "+segment4

ELSE

segment_5=pointer3-1

segment5=extract(segment4,1,segment_5)

length3=string_length(segment4)-pointer3

segment_6=pointer3+1

segment6=extract(segment4,segment_6,length3)

pointer4=search(segment6,"_")

IF pointer4 ==0

BOM_NAME=segment1+" "+segment3+" "+segment5+" "+segment6

ELSE

segment_7=pointer4-1

segment7=extract(segment6,1,segment_7)

length4=string_length(segment6)-pointer4

segment_8=pointer4+1

segment8=extract(segment6,segment_8,length4)

BOM_NAME=segment1+" "+segment3+" "+segment5+" "+segment7+" "+segment8

ENDIF

ENDIF

ENDIF

ENDIF

ENDIF

skashyap
4-Participant
(To:pkumar-6)

Hi Pradeep,

Do you want to include quantity in bom balloon custom symbol?

While creating the symbol, create a note as \quantity\ and give variable text attribute as qty.

This works!

Regards,

Srikanth

Top Tags