Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

Baffling Expression Error - NX9

Status
Not open for further replies.

3dr

Automotive
Joined
Jul 10, 2004
Messages
456
Location
US
Since I've started to heavily use expressions I get this once in a while.

Ex: Expressions

Name Formula
Percentage_Clearance = p865 ( This value pulled from the attribute table) Actual Value = .08
T_Matl_X = "XXXX - 050 - 1"::T" (This value pulled from another part) Actual Value = .029

If I combine them in an expression like this:
Percentage_Clearance*T_Matl_X
I get this error: "Area was found where length was expected"

If I just change just 1 of the 2 expression names to the actual value like this:
Percentage_Clearance*.029
I get the correct result = .00232

Attribute type is Number and Length.

Is there a good reason why this doesn't work???

TIA

Dave

 
You are multiplying 2 length values together and trying to put the result in another 'length' value expression.

Check the expression types of p865, Percentage_Clearance, and T_Matl_X.

www.nxjournaling.com
 
Yes Cowski your right... they are both length.

But I've written thousands of expressions in the last 3 months and they are either length or angle.
I rarely use angle and I've only encountered this error a very small percentage of the time.

If I use area the application of the resulting value is no good to me.

Isn't there a generic "number" type?
Percentage doesn't seem to be an option... which is what the .08 value is






 
There is a "constant" type in the expressions which I almost exclusively use because sometimes you just don't know how an expression will be used in the future. Whether you agree with this practice or not it has never bitten me in any way, qualified by saying I don't do a lot of fancy mathematics.
 
OK.. I'm a moron. Never saw the "constant" just above length.


Live and learn!!

Thanks

Dave
 
The changes made to the 'Expression' system (I can't recall exactly when that took place since the oldest version of NX that I currently have access to is NX 5.0) when we added support for Dimensionality and Units was part of an effort to provide not only a 'calculator-like' functionality but a true engineering 'formula builder' and solver.

As for the use of the 'Constant' Dimensionality, there are no problems with doing that since its use will in no way interfere with the use of Units or other Dimensionalities, as was already discovered. And of course, any legacy files from before these changes will be updated with the assumption that all previous expressions were simply created using the Dimensionality of 'Conatant'.

That being said, please be aware that as far as NX is concerned, whenever you create any sort of feature or constraint or whatever that includes expressions, they will be created using the appropriate Dimensionality and Units and these CANNOT be altered or modified. Now this shouldn't be a problem for users who have adopted this "always create 'Constant' expressions" approach but they will still need to be careful when setting the value of one expression defined by the system by referencing the value of another expression defined by the system since there will be no way to avoid having to use the proper Dimensionality.

As a bit of a side bar, Units are only an issue when you start mixing Dimensionalities, as has already been commented on, however when it comes to units WITHIN one Dimensionality type, for example, when working with 'Length' expressions, mixing Imperial (Inch, Feet, Mile, etc.) and Metric (Millimeters, Meters, Kilometers, etc.) units will simply convert the values so that you always get the correct 'size'.

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.
 
Good input and thanks!

I can't believe something so fundamental and obvious got passed me like that.

Now that I have this huge effort behind me hopefully having all the expressions I've made in "Length" isn't going to screw things up somewhere down the road.


Dave
 
Generally speaking, unless your 'user-defined' expressions are being created specifically for use in some sort of engineering formula where Units and Dimensionality are required, you're probably better off just using the 'Constant' setting, particularly if they are going to be used only as operands, that is a number which will be used to multiply or divide some other expression by, whether that second expression has Dimensionality or not.

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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top