Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

format a string in drawing

Status
Not open for further replies.

uwam2ie

Automotive
Jul 11, 2005
1,008
I have string on a drawing controlled from an attribute and want to hide the last six characters from display.(nx8). Any format controlling available?
regards
 
Replies continue below

Recommended for you

I would also be very interested in that if possible
 
If I understand your question correctly, one way is to capture the number in an expression and then use it in and attribute with the limiting number wanted showing.an example would be having the weight pulled from the part with 8 digits after the decimal but having only 2 digits after the decimal show up in the attribute on the drawing.

In the expressions I have:
Kg_weight = (MakeNumber(ug_askPartAttrValue("weight (kg)")))

Then the applied attribute is: "Insert Annotation-->Note", Relationships, "Insert Expression"
<X0.2@Kg_weight> Kg

This takes the weight of 44.7849000000000 and shows 44.78 Kg on the drawing
 
@sam5a1
yes and no my text attribute is a combination from date and time. I want to get rid of the time portion of the string
 
Create a new expression and reference the date stamp attribute, for this example I'll call the new expression DateTime. Create another new expression of type "string", and for the formula enter:

Code:
subString(DateTime,1,length(DateTime)-6)

This will return the DateTime string variable, minus the last 6 characters. Use this new expression for your note.

www.nxjournaling.com
 
thx cowski
maybe a way to do it, are there no formating tricks from the note editor?
 
The really pain is I want to use the new attribute schema Nx8 and above. In Nx 8.03 you can use the date datatype format attribute.It is this comination of date and time. Problem is cell formating in the titleblock cell doesn't work, no string formating. ??? regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor