Expressions: query existing expressions

Expressions are used extensively in NX; they are the parameters of your parametric model. If you write journal code, chances are good that you will need to deal with expressions sooner or later. The code below illustrates how to access all of the expressions in the work part and it shows how to use several key properties and methods of expression objects. When run, the journal will write information about each expression in the current work part to the information window.

Change Expression Units

The expression system in NX is "'unit aware" and can correctly handle a wide variety of unit types. This can make life easier since the designer no longer has to worry about unit conversions when creating expressions. Create a new length expression using units of centimeters, add an existing expression defined in inches to another defined in millimeters and you get the correct length expressed in centimeters.