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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

how to truncate a drawing note field

ptc-2211192
2-Guest

how to truncate a drawing note field

hello all-

I am using parameter &dwg_name on my drawing. I need ot truncte some letters at the end of that parameter. what is the best way to go about that?

Thanks


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.
8 REPLIES 8

Unfortunately we can't create drawing relations. But if the parameter &dwg_name exists in the part, you can create a part relation that truncates it and creates a new parameter that you can reference as the drawing name:

new_name=extract(dwg_name,1,3)

In parenthesis is the string name, the position to start extracting from, and the number of charaters to extract (including the current postion). So, in the example above, if dwg_name is ABCDEFG, new_name will become ABC.

Thank you very much

so now I import a .tbl file with the parameters in. how can I modify that .tbl file to reflect the new parameter?

I'll assume you are not creating a new format. Set the model with the parameter you want as the active model in the drawing (if you have more than one model) and then just reference the new parameter in the table....edit the cell that has the drawing name and enter the new parameter as so: &new_name.

when I try to edit it it brings up the report symbol screen and does no allow me to put in or pick the new parameter. what am I missing?

Sounds like it's in a table repeat region. In a repeat region, you can only edit the cell that drives the repeat region. What you enter depends on whether its within an assembly or part Bring up the report symbol screen again and select the following:

If it's within an assembly:

asm...

mbr...

User Defined

enter the name of your parameter i.e. new_name

If it's a part:

mbr...

User Defined

enter the name of your parameter i.e. new_name

You can also edit the driving cell of the repeat region and manually enter one of the following:

&asm.mbr.new_name

&mbr.new_name

&new_name

It's a little difficult to give you a good answer without seeing exactly what you are doing...flying blind here.

Thank you my inexperince shows.

now I get "new_name=extract(dwg_name,1,3)" in my table.

I must not have created the paramter correctly. what I did was create a new parameter and gave it the value new_name=extract(dwg_name,1,3)

is that correct?

The value you entered for the parameter should be a relation, not a parameter. Go to tools--relations and Enter that on the new line. It assumes that you have a parameter called dwg_name in your part.

Sorry, looks like I may have mislead you. I was thinking that dwg_name was a user defined parameter that you came up with, and forgot that it is a system parameter in every drawing.

In this case, I don't know if there is a way to truncate it because we can't create drawing relations and I don't think you can pull that parameter into a part or assembly from another drawing. Depending on what you are doing, you'll have to either create a part or drawing parameter and manually enter the information. Unless the part name or similar parameter in the model is the same as the drawing name.

Top Tags