NX Open C++ Reference Guide
Public Types | Public Member Functions | List of all members
NXOpen::Expression Class Reference

Represents an expression. More...

Inheritance diagram for NXOpen::Expression:
NXOpen::NXObjectNXOpen::TaggedObjectNXOpen::INXObject

Public Types

enum   UnitsOption { UnitsOptionBase, UnitsOptionExpression }
  Indicates the units to use when getting an expression's value. More...
 
- Public Types inherited from NXOpen::NXObject
enum   AttributeType {
  AttributeTypeInvalid, AttributeTypeNull, AttributeTypeBoolean, AttributeTypeInteger,
  AttributeTypeReal, AttributeTypeString, AttributeTypeTime, AttributeTypeReference,
  AttributeTypeAny = 100
}
  Specifies attribute type. More...
 
enum   DateAndTimeFormat { DateAndTimeFormatNumeric, DateAndTimeFormatTextual }
  Specifies the format of the date and time attribute. More...
 

Public Member Functions

bool  BooleanValue ()
  Returns the boolean value of the expression.
 
NXString  Description ()
  Returns the description of the expression.
 
void  EditComment (const NXString &newComment)
  Changes the comment.
 
void  EditComment (const char *newComment)
  Changes the comment.
 
NXString  Equation ()
  Returns the equation of the expression in the form: name = right_hand_side.
 
NXString  GetDescriptor ()
  Returns the descriptor for the expression, or NULL if there is no descriptor.
 
NXOpen::Features::Feature GetOwningFeature ()
  Returns the feature that created the supplied expression.
 
NXOpen::Features::Feature GetOwningRpoFeature ()
  Returns the feature whose rpo_transform created the supplied positioning dimension expression.
 
std::vector< NXOpen::Expression * >  GetReferencingExpressions ()
  Returns all the referencing expressions of the expression.
 
std::vector
< NXOpen::Features::Feature * > 
GetUsingFeatures ()
  Returns an array of the features that use the supplied expression.
 
double  GetValueUsingUnits (NXOpen::Expression::UnitsOption unitsOption)
  Get the value of the expression, in either base units or the expression's units.
 
int  IntegerValue ()
  Returns the integer value of the expression.
 
bool  IsGeometricExpression ()
  Returns whether the expression is a geometric expression.
 
bool  IsMeasurementExpression ()
  Returns whether the expression is owned by a measurement.
 
bool  IsNoEdit ()
  Returns whether the expression is edit locked.
 
bool  IsUserLocked ()
  Returns whether the expression is user locked.
 
NXOpen::Point3d  PointValue ()
  Returns the point value of the expression.
 
NXString  RightHandSide ()
  Returns the right hand side of the expression.
 
void  SetNoEdit (bool isNoEdit)
  Sets whether the expression is edit locked.
 
void  SetRightHandSide (const NXString &rightHandSide)
  设置表达式的右侧.
 
void  SetRightHandSide (const char *rightHandSide)
  Sets the right hand side of the expression.
 
void  SetUnits (NXOpen::Unit *unitType)
  Sets the units for the expression.
 
void  SetUserLocked (bool isLocked)
  Sets whether the expression is user locked.
 
void  SetValue (double expressionValue)
  Sets the value of the expression in base units.
 
NXString  StringValue ()
  Returns the string value of the expression.
 
NXString  Type ()
  Returns the type of the expression.
 
NXOpen::Unit Units ()
  Returns the units for the expression.
 
double  Value ()
  Returns the value of the expression in base units.
 
NXOpen::Vector3d  VectorValue ()
  Returns the vector value of the expression.
 
- Public Member Functions inherited from NXOpen::NXObject
void  DeleteAllAttributesByType (NXOpen::NXObject::AttributeType type)
  Deletes all attributes of a specific type.
 
void  DeleteAllAttributesByType (NXOpen::NXObject::AttributeType type, NXOpen::Update::Option option)
  Deletes all attributes of a specific type with the option to update or not.
 
void  DeleteAttributeByTypeAndTitle (NXOpen::NXObject::AttributeType type, const NXString &title)
  Deletes an attribute by type and title.
 
void  DeleteAttributeByTypeAndTitle (NXOpen::NXObject::AttributeType type, const char *title)
  Deletes an attribute by type and title.
 
void  DeleteAttributeByTypeAndTitle (NXOpen::NXObject::AttributeType type, const NXString &title, NXOpen::Update::Option option)
  Deletes an attribute by type and title with the option to update or not.
 
void  DeleteAttributeByTypeAndTitle (NXOpen::NXObject::AttributeType type, const char *title, NXOpen::Update::Option option)
  Deletes an attribute by type and title with the option to update or not.
 
void  DeleteUserAttribute (NXOpen::NXObject::AttributeType type, const NXString &title, bool deleteEntireArray, NXOpen::Update::Option option)
  Deletes the first attribute encountered with the given Type, Title and Index.
 
void  DeleteUserAttribute (NXOpen::NXObject::AttributeType type, const char *title, bool deleteEntireArray, NXOpen::Update::Option option)
  Deletes the first attribute encountered with the given Type, Title and Index.
 
void  DeleteUserAttributes (NXOpen::NXObject::AttributeType type, NXOpen::Update::Option option)
  Deletes the attributes encountered with the given Type with option to update or not.
 
virtual NXOpen::INXObject FindObject (const NXString &journalIdentifier)
  Finds the NXObject with the given identifier as recorded in a journal.
 
NXOpen::INXObject FindObject (const char *journalIdentifier)
  Finds the NXObject with the given identifier as recorded in a journal.
 
std::vector
< NXOpen::NXObject::AttributeInformation
GetAttributeTitlesByType (NXOpen::NXObject::AttributeType type)
  Gets all the attribute titles of a specific type.
 
bool  GetBooleanUserAttribute (const NXString &title, int index)
  Gets a boolean attribute by Title and array Index.
 
bool  GetBooleanUserAttribute (const char *title, int index)
  Gets a boolean attribute by Title and array Index.
 
NXOpen::NXObject::ComputationalTime  GetComputationalTimeUserAttribute (const NXString &title, int index)
  Gets a time attribute by Title and array Index.
 
NXOpen::NXObject::ComputationalTime  GetComputationalTimeUserAttribute (const char *title, int index)
  Gets a time attribute by Title and array Index.
 
int  GetIntegerAttribute (const NXString &title)
  Gets an integer attribute by title.
 
int  GetIntegerAttribute (const char *title)
  Gets an integer attribute by title.
 
int  GetIntegerUserAttribute (const NXString &title, int index)
  Gets an integer attribute by Title and array Index.
 
int  GetIntegerUserAttribute (const char *title, int index)
  Gets an integer attribute by Title and array Index.
 
double  GetRealAttribute (const NXString &title)
  Gets a real attribute by title.
 
double  GetRealAttribute (const char *title)
  Gets a real attribute by title.
 
double  GetRealUserAttribute (const NXString &title, int index)
  Gets a real attribute by Title and array Index.
 
double  GetRealUserAttribute (const char *title, int index)
  Gets a real attribute by Title and array Index.
 
NXString  GetReferenceAttribute (const NXString &title)
  Gets the reference string (not the calculated value) of a string attribute that uses a reference string.
 
NXString  GetReferenceAttribute (const char *title)
  Gets the reference string (not the calculated value) of a string attribute that uses a reference string.
 
NXString  GetStringAttribute (const NXString &title)
  Gets a string attribute value by title.
 
NXString  GetStringAttribute (const char *title)
  Gets a string attribute value by title.
 
NXString  GetStringUserAttribute (const NXString &title, int index)
  Gets a string attribute by Title and array Index.
 
NXString  GetStringUserAttribute (const char *title, int index)
  Gets a string attribute by Title and array Index.
 
NXString  GetTimeAttribute (NXOpen::NXObject::DateAndTimeFormat format, const NXString &title)
  Gets a time attribute by title.
 
NXString  GetTimeAttribute (NXOpen::NXObject::DateAndTimeFormat format, const char *title)
  Gets a time attribute by title.
 
NXString  GetTimeUserAttribute (const NXString &title, int index)
  Gets a time attribute by Title and array Index.
 
NXString  GetTimeUserAttribute (const char *title, int index)
  Gets a time attribute by Title and array Index.
 
NXOpen::NXObject::AttributeInformation  GetUserAttribute (const NXString &title, NXOpen::NXObject::AttributeType type, int index)
  Gets the first attribute encountered on the object, if any, with a given Title, Type and array Index.
 
NXOpen::NXObject::AttributeInformation  GetUserAttribute (const char *title, NXOpen::NXObject::AttributeType type, int index)
  Gets the first attribute encountered on the object, if any, with a given Title, Type and array Index.
 
NXString  GetUserAttributeAsString (const NXString &title, NXOpen::NXObject::AttributeType type, int index)
  Gets the first attribute encountered on the object, if any, with a given title, type and array index.
 
NXString  GetUserAttributeAsString (const char *title, NXOpen::NXObject::AttributeType type, int index)
  Gets the first attribute encountered on the object, if any, with a given title, type and array index.
 
bool  GetUserAttributeLock (const NXString &title, NXOpen::NXObject::AttributeType type)
  Determine the lock of the given attribute.
 
bool  GetUserAttributeLock (const char *title, NXOpen::NXObject::AttributeType type)
  Determine the lock of the given attribute.
 
std::vector
< NXOpen::NXObject::AttributeInformation
GetUserAttributes ()
  Gets all the attributes that have been set on the given object.
 
std::vector
< NXOpen::NXObject::AttributeInformation
GetUserAttributes (bool includeUnset)
  Gets all the attributes that have been set on the given object.
 
std::vector
< NXOpen::NXObject::AttributeInformation
GetUserAttributes (bool includeUnset, bool addStringValues)
  Gets all the attributes that have been set on the given object.
 
std::vector< NXString GetUserAttributesAsStrings ()
  Gets all the attributes that have been set on the given object.
 
std::vector< NXOpen::NXObject * >  GetUserAttributeSourceObjects ()
  Returns an array of objects from which this object presents attributes.
 
bool  HasUserAttribute (const NXString &title, NXOpen::NXObject::AttributeType type, int index)
  Determines if an attribute with the given Title, Type and array Index is present on the object If the attribute is not an array, the Index is ignored (if this is known beforehand, we recommend setting the Index to -1 to save time).
 
bool  HasUserAttribute (const char *title, NXOpen::NXObject::AttributeType type, int index)
  Determines if an attribute with the given Title, Type and array Index is present on the object If the attribute is not an array, the Index is ignored (if this is known beforehand, we recommend setting the Index to -1 to save time).
 
virtual bool  IsOccurrence ()
  Returns whether this object is an occurrence or not.
 
virtual NXString  JournalIdentifier ()
  Returns the identifier that would be recorded in a journal for this object.
 
virtual NXString  Name ()
  Returns the custom name of the object.
 
virtual
NXOpen::Assemblies::Component
OwningComponent ()
  Returns the owning component, if this object is an occurrence.
 
virtual NXOpen::BasePart OwningPart ()
  Returns the owning part of this object
Created in NX3.0.0.
 
virtual void  Print ()
  Prints a representation of this object to the system log file.
 
virtual NXOpen::INXObject Prototype ()
  Returns the prototype of this object if it is an occurrence.
 
void  SetAttribute (const NXString &title, int value)
  Creates or modifies an integer attribute.
 
void  SetAttribute (const char *title, int value)
  Creates or modifies an integer attribute.
 
void  SetAttribute (const NXString &title, int value, NXOpen::Update::Option option)
  Creates or modifies an integer attribute with the option to update or not.
 
void  SetAttribute (const char *title, int value, NXOpen::Update::Option option)
  Creates or modifies an integer attribute with the option to update or not.
 
void  SetAttribute (const NXString &title, double value)
  Creates or modifies a real attribute.
 
void  SetAttribute (const char *title, double value)
  Creates or modifies a real attribute.
 
void  SetAttribute (const NXString &title, double value, NXOpen::Update::Option option)
  Creates or modifies a real attribute with the option to update or not.
 
void  SetAttribute (const char *title, double value, NXOpen::Update::Option option)
  Creates or modifies a real attribute with the option to update or not.
 
void  SetAttribute (const NXString &title, const NXString &value)
  Creates or modifies a string attribute.
 
void  SetAttribute (const char *title, const char *value)
  Creates or modifies a string attribute.
 
void  SetAttribute (const NXString &title, const NXString &value, NXOpen::Update::Option option)
  Creates or modifies a string attribute with the option to update or not.
 
void  SetAttribute (const char *title, const char *value, NXOpen::Update::Option option)
  Creates or modifies a string attribute with the option to update or not.
 
void  SetAttribute (const NXString &title)
  Creates or modifies a null attribute which is an attribute with a title and no value.
 
void  SetAttribute (const char *title)
  Creates or modifies a null attribute which is an attribute with a title and no value.
 
void  SetAttribute (const NXString &title, NXOpen::Update::Option option)
  Creates or modifies a null attribute with the option to update or not.
 
void  SetAttribute (const char *title, NXOpen::Update::Option option)
  Creates or modifies a null attribute with the option to update or not.
 
void  SetBooleanUserAttribute (const NXString &title, int index, bool value, NXOpen::Update::Option option)
  Creates or modifies a boolean attribute with the option to update or not.
 
void  SetBooleanUserAttribute (const char *title, int index, bool value, NXOpen::Update::Option option)
  Creates or modifies a boolean attribute with the option to update or not.
 
virtual void  SetName (const NXString &name)
  Sets the custom name of the object.
 
void  SetName (const char *name)
  Sets the custom name of the object.
 
void  SetReferenceAttribute (const NXString &title, const NXString &value)
  Creates or modifies a string attribute which uses a reference string.
 
void  SetReferenceAttribute (const char *title, const char *value)
  Creates or modifies a string attribute which uses a reference string.
 
void  SetReferenceAttribute (const NXString &title, const NXString &value, NXOpen::Update::Option option)
  Creates or modifies a string attribute which uses a reference string, with the option to update or not.
 
void  SetReferenceAttribute (const char *title, const char *value, NXOpen::Update::Option option)
  Creates or modifies a string attribute which uses a reference string, with the option to update or not.
 
void  SetTimeAttribute (const NXString &title, const NXString &value)
  Creates or modifies a time attribute.
 
void  SetTimeAttribute (const char *title, const char *value)
  Creates or modifies a time attribute.
 
void  SetTimeAttribute (const NXString &title, const NXString &value, NXOpen::Update::Option option)
  Creates or modifies a time attribute with the option to update or not.
 
void  SetTimeAttribute (const char *title, const char *value, NXOpen::Update::Option option)
  Creates or modifies a time attribute with the option to update or not.
 
void  SetTimeUserAttribute (const NXString &title, int index, const NXString &value, NXOpen::Update::Option option)
  Creates or modifies a time attribute with the option to update or not.
 
void  SetTimeUserAttribute (const char *title, int index, const char *value, NXOpen::Update::Option option)
  Creates or modifies a time attribute with the option to update or not.
 
void  SetTimeUserAttribute (const NXString &title, int index, const NXOpen::NXObject::ComputationalTime &value, NXOpen::Update::Option option)
  Creates or modifies a time attribute with the option to update or not.
 
void  SetTimeUserAttribute (const char *title, int index, const NXOpen::NXObject::ComputationalTime &value, NXOpen::Update::Option option)
  Creates or modifies a time attribute with the option to update or not.
 
void  SetUserAttribute (const NXOpen::NXObject::AttributeInformation &info, NXOpen::Update::Option option)
  Creates or modifies an attribute with the option to update or not.
 
void  SetUserAttribute (const NXString &title, int index, int value, NXOpen::Update::Option option)
  Creates or modifies an integer attribute with the option to update or not.
 
void  SetUserAttribute (const char *title, int index, int value, NXOpen::Update::Option option)
  Creates or modifies an integer attribute with the option to update or not.
 
void  SetUserAttribute (const NXString &title, int index, double value, NXOpen::Update::Option option)
  Creates or modifies a real attribute with the option to update or not.
 
void  SetUserAttribute (const char *title, int index, double value, NXOpen::Update::Option option)
  Creates or modifies a real attribute with the option to update or not.
 
void  SetUserAttribute (const NXString &title, int index, const NXString &value, NXOpen::Update::Option option)
  Creates or modifies a string attribute with the option to update or not.
 
void  SetUserAttribute (const char *title, int index, const char *value, NXOpen::Update::Option option)
  Creates or modifies a string attribute with the option to update or not.
 
void  SetUserAttribute (const NXString &title, int index, NXOpen::Update::Option option)
  Creates or modifies a null attribute with the option to update or not.
 
void  SetUserAttribute (const char *title, int index, NXOpen::Update::Option option)
  Creates or modifies a null attribute with the option to update or not.
 
void  SetUserAttributeLock (const NXString &title, NXOpen::NXObject::AttributeType type, bool lock)
  Lock or unlock the given attribute.
 
void  SetUserAttributeLock (const char *title, NXOpen::NXObject::AttributeType type, bool lock)
  Lock or unlock the given attribute.
 
- Public Member Functions inherited from NXOpen::TaggedObject
tag_t  GetTag () const
 
<b>Deprecated</b>:<br>

   Use Tag instead.

 
tag_t  Tag () const
  Returns the tag of this object.
 
- Public Member Functions inherited from NXOpen::INXObject
NXOpen::INXObject FindObject (const char *journalIdentifier)
  Finds the NXObject with the given identifier as recorded in a journal.
 
void  SetName (const char *name)
  Sets the custom name of the object.
 

Detailed Description

Represents an expression.


To create a new instance of this class, use ExpressionCollection::CreateWithUnits

Created in NX3.0.0.

Member Enumeration Documentation

Indicates the units to use when getting an expression's value.

Enumerator:
UnitsOptionBase 

Return expression value in base part units.

UnitsOptionExpression 

Return expression value in expression units.

Member Function Documentation

bool NXOpen::Expression::BooleanValue ( )

Returns the boolean value of the expression.

This must only be used on boolean expressions.
Created in NX6.0.0.

License requirements : None

NXString NXOpen::Expression::Description ( )

Returns the description of the expression.


Created in NX5.0.2.

License requirements : None

void NXOpen::Expression::EditComment ( const NXString newComment )

Changes the comment.


Created in NX4.0.0.

License requirements : None

Parameters
newComment comment
void NXOpen::Expression::EditComment ( const char *  newComment )

Changes the comment.


Created in NX4.0.0.

License requirements : None

Parameters
newComment comment
NXString NXOpen::Expression::Equation ( )

Returns the equation of the expression in the form: name = right_hand_side.


Created in NX3.0.0.

License requirements : None

NXString NXOpen::Expression::GetDescriptor ( )

Returns the descriptor for the expression, or NULL if there is no descriptor.

Currently, only feature expressions have descriptors.

Returns
Expression descriptor.
Created in NX4.0.0.

License requirements : None
NXOpen::Features::Feature* NXOpen::Expression::GetOwningFeature ( )

Returns the feature that created the supplied expression.

<br> This is the feature that created it during feature creation.  For example,

the expression "p0 = x" is owned by feature "BLOCK(0)".


This works with both normal expressions and expressions created by the geometric expression feature.

Returns
owning feature or NULL
Created in NX4.0.0.

License requirements : None
NXOpen::Features::Feature* NXOpen::Expression::GetOwningRpoFeature ( )

Returns the feature whose rpo_transform created the supplied positioning dimension expression.

<br> This is the feature that created it during positioning the feature.  For example,

the expression "p0 = x" is owned by the Transform of feature "Boss(2)".


This works with expressions created by the feature with rpo.

Returns
owning rpo feature or NULL
Created in NX7.5.0.

License requirements : None
std::vector<NXOpen::Expression *> NXOpen::Expression::GetReferencingExpressions ( )

Returns all the referencing expressions of the expression.

Returns

Created in NX8.0.0.

License requirements : None
std::vector<NXOpen::Features::Feature *> NXOpen::Expression::GetUsingFeatures ( )

Returns an array of the features that use the supplied expression.

Returns
array of features, or empty array
Created in NX4.0.0.

License requirements : None
double NXOpen::Expression::GetValueUsingUnits ( NXOpen::Expression::UnitsOption  unitsOption )

Get the value of the expression, in either base units or the expression's units.

This method must only be used on number expressions.

Returns

Created in NX4.0.0.

License requirements : None
Parameters
unitsOption use base units or expression units
int NXOpen::Expression::IntegerValue ( )

Returns the integer value of the expression.

This must only be used on integer expressions.
Created in NX6.0.0.

License requirements : None

bool NXOpen::Expression::IsGeometricExpression ( )

Returns whether the expression is a geometric expression.


Created in NX4.0.0.

License requirements : None

bool NXOpen::Expression::IsMeasurementExpression ( )

Returns whether the expression is owned by a measurement.


Created in NX5.0.0.

License requirements : None

bool NXOpen::Expression::IsNoEdit ( )

Returns whether the expression is edit locked.

If this property is false, then the expression can be edited. (This is the default state for newly created expressions.) If this property is true, then the expression cannot be edited.


Created in NX8.5.0.

License requirements : None

bool NXOpen::Expression::IsUserLocked ( )

Returns whether the expression is user locked.

If this property is false, then the expression can be over-ridden from another part. (This is the default state for newly created expressions.) If this property is true, you are not allowed to over-ride it.


Note that if an expression is currently over-ridden, you cannot set its lock property. In this instance, an exception will be thrown.


Created in NX4.0.0.

License requirements : None

NXOpen::Point3d NXOpen::Expression::PointValue ( )

Returns the point value of the expression.

This must only be used on point expressions.
Created in NX6.0.0.

License requirements : None

NXString NXOpen::Expression::RightHandSide ( )

Returns the right hand side of the expression.

<br> When setting the property, changes are not applied to the system until
   @link Update::DoUpdate Update::DoUpdate@endlink  is called  <br>  


Created in NX3.0.0.

License requirements : None

void NXOpen::Expression::SetNoEdit ( bool  isNoEdit )

Sets whether the expression is edit locked.

If this property is false, then the expression can be edited. (This is the default state for newly created expressions.) If this property is true, then the expression cannot be edited.


Created in NX8.5.0.

License requirements : None

Parameters
isNoEdit is no edit
void NXOpen::Expression::SetRightHandSide ( const NXString rightHandSide )

Sets the right hand side of the expression.

<br> When setting the property, changes are not applied to the system until
   @link Update::DoUpdate Update::DoUpdate@endlink  is called  <br>  


Created in NX3.0.0.

License requirements : None

Parameters
rightHandSide right hand side
void NXOpen::Expression::SetRightHandSide ( const char *  rightHandSide )

Sets the right hand side of the expression.

<br> When setting the property, changes are not applied to the system until
   @link Update::DoUpdate Update::DoUpdate@endlink  is called  <br>  


Created in NX3.0.0.

License requirements : None

Parameters
rightHandSide right hand side
void NXOpen::Expression::SetUnits ( NXOpen::Unit unitType )

Sets the units for the expression.

This must only be used on number expressions.
Created in NX5.0.0.

License requirements : None

Parameters
unitType unit type
void NXOpen::Expression::SetUserLocked ( bool  isLocked )

Sets whether the expression is user locked.

If this property is false, then the expression can be over-ridden from another part. (This is the default state for newly created expressions.) If this property is true, you are not allowed to over-ride it.


Note that if an expression is currently over-ridden, you cannot set its lock property. In this instance, an exception will be thrown.


Created in NX4.0.0.

License requirements : None

Parameters
isLocked is locked
void NXOpen::Expression::SetValue ( double  expressionValue )

Sets the value of the expression in base units.

This method must only be used on number expressions. When setting the value, any formula in the expression is replaced by a numeric value, even if the value is the same as the value that the formula evaluates to.
Created in NX6.0.1.

License requirements : None

Parameters
expressionValue expressionvalue
NXString NXOpen::Expression::StringValue ( )

Returns the string value of the expression.

This must only be used on string expressions.
Created in NX5.0.0.

License requirements : None

NXString NXOpen::Expression::Type ( )

Returns the type of the expression.


Created in NX5.0.0.

License requirements : None

NXOpen::Unit* NXOpen::Expression::Units ( )

Returns the units for the expression.

This must only be used on number expressions.
Created in NX4.0.0.

License requirements : None

double NXOpen::Expression::Value ( )

Returns the value of the expression in base units.

This method must only be used on number expressions. When setting the value, any formula in the expression is replaced by a numeric value, even if the value is the same as the value that the formula evaluates to.
Created in NX3.0.0.

License requirements : None

NXOpen::Vector3d NXOpen::Expression::VectorValue ( )

Returns the vector value of the expression.

This must only be used on vector expressions.
Created in NX6.0.0.

License requirements : None


The documentation for this class was generated from the following file:
Copyright 2013 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.