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!

trying to use expression formula in note text instead of value

Status
Not open for further replies.

aluminum2

Aerospace
Apr 27, 2010
218
I am inserting a UDF and I have a way of selecting multiple fractions for example 1/4 . When the UDF is used, there is an expression that shows up and the formula for it reads 1/4, but the value reads .2500 . In my operation sheet I would like the note to read 1/4, but with <x0.4@expressionname> it reads .2500. Is there anyway I can get my operation sheet to read a fraction from the UDF data?

I am using nx 8
 
Replies continue below

Recommended for you

What it sounds like you're asking for is the ability to have a numerical value created (and edited) as a fraction but where you get the results as TWO expressions, one a floating point number and the other a string showing the fraction as just that, a fraction.

While I haven't created an actual UDF, I have created a simple part file (attached below) which contains only expressions, but if you follow what I've done I think you can accomplish what you're looking for. The trick is that there's no way (without writing a custom program) to go directly from a floating point number to a fractional string, or vice versa. However, if you define TWO expressions, one for the 'denominator' and one for the 'numerator' of your 'fractional' variable, you can then take these two expressions and combine them so that you get both types of output expressions simultaneously. I'm not sure if this 'workaround' will be acceptable, but I can't think of anything at the moment (using only built-in functionality) which will give a floating point expression and a string expression which will always represent the same numerical value.

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.
 
 http://files.engineering.com/getfile.aspx?folder=75411930-b674-4a62-ba34-71229683caf0&file=fraction_to_expression_example.prt
Thanks for your response. I might have to do this work around in another situaion, but I found out that I can make a dimension and change the settings to convert the number to a fraction to the nearest /64.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor