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

Represents a collection of expressions. More...

Inheritance diagram for NXOpen::ExpressionCollection:
NXOpen::TaggedObjectCollection

Classes

class  iterator
 Iterator for accessing the contents of the collection. More...
 

Public Types

enum  ExportMode { ExportModeWorkPart, ExportModeAllInAssyTree, ExportModeAllParts }
 Indicates the mode for exporting expressions. More...
 
enum  ImportMode { ImportModeReplace, ImportModeDontReplace, ImportModeDeleteImports }
 Indicates the mode for importing expressions. More...
 
enum  SortType { SortTypeAlphaNum, SortTypeTimeStamp, SortTypeReverseTimeStamp }
 Indicates the mode for sorting expressions. More...
 

Public Member Functions

NXString AskInterpartLhsName (NXOpen::Expression *sourceExpression)
 Returns the left hand side name for an overriding interpart expression reference. More...
 
NXString AskInterpartRhsName (NXOpen::Expression *sourceExpression)
 Returns the right hand side name for an interpart expression reference. More...
 
iterator begin ()
 Returns an iterator addressing the first element. More...
 
void ChangeInterpartReferences (const NXString &oldPartName, const NXString &newPartName)
 Changes all of the references in the part "owning_part" from expressions in the part "old_part_name" to expressions in the part "new_part_name". More...
 
void ChangeInterpartReferences (const char *oldPartName, const char *newPartName)
 Changes all of the references in the part "owning_part" from expressions in the part "old_part_name" to expressions in the part "new_part_name". More...
 
void ChangeInterpartReferences (const NXString &oldPartName, const NXString &newPartName, bool doUpdate, bool doChecking)
 Changes all of the references in the part "owning_part" from expressions in the part "old_part_name" to expressions in the part "new_part_name". More...
 
void ChangeInterpartReferences (const char *oldPartName, const char *newPartName, bool doUpdate, bool doChecking)
 Changes all of the references in the part "owning_part" from expressions in the part "old_part_name" to expressions in the part "new_part_name". More...
 
NXOpen::ExpressionCreate (const NXString &string)
 Creates an expression. More...
 
NXOpen::ExpressionCreate (const char *string)
 Creates an expression. More...
 
NXOpen::ExpressionCreateExpression (const NXString &expressionType, const NXString &string)
 Creates an expression of the specified type. More...
 
NXOpen::ExpressionCreateExpression (const char *expressionType, const char *string)
 Creates an expression of the specified type. More...
 
NXOpen::InterpartExpressionsBuilderCreateInterpartExpressionsBuilder ()
 Creates interpart expressions. More...
 
NXOpen::ReplaceExpressionsBuilderCreateReplaceExpressionsBuilder ()
 Replace expressions. More...
 
NXOpen::SuppressByExpressionBuilderCreateSuppressByExpressionBuilder ()
 Creates a NXOpen::SuppressByExpressionBuilder. More...
 
NXOpen::ExpressionCreateSystemExpression (const NXString &string)
 Creates a system expression. More...
 
NXOpen::ExpressionCreateSystemExpression (const char *string)
 Creates a system expression. More...
 
NXOpen::ExpressionCreateSystemExpression (const NXString &expressionType, const NXString &string)
 Creates a system expression of the specified type. More...
 
NXOpen::ExpressionCreateSystemExpression (const char *expressionType, const char *string)
 Creates a system expression of the specified type. More...
 
NXOpen::ExpressionCreateSystemExpressionFromReferenceString (const NXString &reference)
 Creates a system string expression from a reference string in Drafting Note format. More...
 
NXOpen::ExpressionCreateSystemExpressionFromReferenceString (const char *reference)
 Creates a system string expression from a reference string in Drafting Note format. More...
 
NXOpen::ExpressionCreateSystemExpressionWithUnits (const NXString &string, NXOpen::Unit *unitType)
 Creates a system expression with units. More...
 
NXOpen::ExpressionCreateSystemExpressionWithUnits (const char *string, NXOpen::Unit *unitType)
 Creates a system expression with units. More...
 
NXOpen::ExpressionCreateWithUnits (const NXString &string, NXOpen::Unit *unitType)
 Creates an expression with units. More...
 
NXOpen::ExpressionCreateWithUnits (const char *string, NXOpen::Unit *unitType)
 Creates an expression with units. More...
 
void Delete (NXOpen::Expression *expression)
 Deletes an expression
Created in NX4.0.0. More...
 
void Edit (NXOpen::Expression *expression, const NXString &newRightHandSide)
 Edits an expression. More...
 
void Edit (NXOpen::Expression *expression, const char *newRightHandSide)
 Edits an expression. More...
 
void EditWithUnits (NXOpen::Expression *expression, NXOpen::Unit *unitType, const NXString &newRightHandSide)
 Edits an expression with units. More...
 
void EditWithUnits (NXOpen::Expression *expression, NXOpen::Unit *unitType, const char *newRightHandSide)
 Edits an expression with units. More...
 
iterator end ()
 Returns an iterator addressing one past the last element. More...
 
void ExportToFile (NXOpen::ExpressionCollection::ExportMode exportMode, const NXString &fileName, NXOpen::ExpressionCollection::SortType sortType)
 Exports the expressions to a text file, or, if 'file_name' is NULL, list the expressions in the listing window. More...
 
void ExportToFile (NXOpen::ExpressionCollection::ExportMode exportMode, const char *fileName, NXOpen::ExpressionCollection::SortType sortType)
 Exports the expressions to a text file, or, if 'file_name' is NULL, list the expressions in the listing window. More...
 
NXOpen::ExpressionFindObject (const NXString &journalIdentifier)
 Finds the NXOpen::Expression with the given identifier as recorded in a journal. More...
 
NXOpen::ExpressionFindObject (const char *journalIdentifier)
 Finds the NXOpen::Expression with the given identifier as recorded in a journal. More...
 
NXOpen::ExpressionGetAttributeExpression (NXOpen::NXObject *object, const NXString &title, NXOpen::NXObject::AttributeType type, int index)
 Get the attribute expression of the specified attribute title/type. More...
 
NXOpen::ExpressionGetAttributeExpression (NXOpen::NXObject *object, const char *title, NXOpen::NXObject::AttributeType type, int index)
 Get the attribute expression of the specified attribute title/type. More...
 
std::vector< NXStringGetInterpartReferences ()
 Returns a list of parts that are referenced from expressions in the part "owning_part". More...
 
void GetInterpartReferencesWithDisplayNames (std::vector< NXString > &referencedPartNames, std::vector< NXString > &referencedDispNames)
 Returns a list of parts that are referenced from expressions in the part "owning_part". More...
 
std::vector< NXOpen::Expression * > GetVisibleExpressions ()
 Returns an array of visible "Number" expressions in the part. More...
 
void ImportFromFile (const NXString &fileName, NXOpen::ExpressionCollection::ImportMode importMode, bool *expModified, std::vector< NXString > &errorMessages)
 Imports expressions from a file. More...
 
void ImportFromFile (const char *fileName, NXOpen::ExpressionCollection::ImportMode importMode, bool *expModified, std::vector< NXString > &errorMessages)
 Imports expressions from a file. More...
 
bool RemoveInterpartReferences (const NXString &partName)
 Removes the interpart references from a part. More...
 
bool RemoveInterpartReferences (const char *partName)
 Removes the interpart references from a part. More...
 
void Rename (NXOpen::Expression *expression, const NXString &newName)
 Changes the name of the expression. More...
 
void Rename (NXOpen::Expression *expression, const char *newName)
 Changes the name of the expression. More...
 
void Replace (const NXString &currentName, const NXString &replaceName)
 Replaces references to an expression with another expression. More...
 
void Replace (const char *currentName, const char *replaceName)
 Replaces references to an expression with another expression. More...
 
void ReplaceAttributeExpression (NXOpen::Expression *expression, NXOpen::NXObject *object, const NXString &title, NXOpen::NXObject::AttributeType type, int index)
 Replace the attribute expression of the specified attribute title/type. More...
 
void ReplaceAttributeExpression (NXOpen::Expression *expression, NXOpen::NXObject *object, const char *title, NXOpen::NXObject::AttributeType type, int index)
 Replace the attribute expression of the specified attribute title/type. More...
 
void SystemRename (NXOpen::Expression *expression, const NXString &newName)
 Changes the name of the expression without marking system expressions as user expressions. More...
 
void SystemRename (NXOpen::Expression *expression, const char *newName)
 Changes the name of the expression without marking system expressions as user expressions. More...
 
tag_t Tag () const
 Returns the tag of this object. More...
 

Detailed Description

Represents a collection of expressions.


To obtain an instance of this class, refer to NXOpen::BasePart

Created in NX3.0.0.

Member Enumeration Documentation

Indicates the mode for exporting expressions.

Enumerator
ExportModeWorkPart 

All expressions in the given part.

ExportModeAllInAssyTree 

All expressions in the given part, and in its components.

ExportModeAllParts 

All expressions in All parts in the session.

Indicates the mode for importing expressions.

Enumerator
ImportModeReplace 

Overwrite existing expressions if the imported values differ.

ImportModeDontReplace 

Don't overwrite existing expressions.

New expressions are created

ImportModeDeleteImports 

Delete all expressions in the imported file.

Indicates the mode for sorting expressions.

Enumerator
SortTypeAlphaNum 

Alphabetic order, with numbers in numerical order.

SortTypeTimeStamp 

Creation order - earliest first.

SortTypeReverseTimeStamp 

Creation order - latest first.

Member Function Documentation

NXString NXOpen::ExpressionCollection::AskInterpartLhsName ( NXOpen::Expression sourceExpression)

Returns the left hand side name for an overriding interpart expression reference.

Returns
left hand side name
Created in NX10.0.0.

License requirements : None
Parameters
sourceExpressionexpression in source part
NXString NXOpen::ExpressionCollection::AskInterpartRhsName ( NXOpen::Expression sourceExpression)

Returns the right hand side name for an interpart expression reference.

Returns
right hand side name
Created in NX10.0.0.

License requirements : None
Parameters
sourceExpressionexpression in source part
iterator NXOpen::ExpressionCollection::begin ( )

Returns an iterator addressing the first element.

void NXOpen::ExpressionCollection::ChangeInterpartReferences ( const NXString oldPartName,
const NXString newPartName 
)

Changes all of the references in the part "owning_part" from expressions in the part "old_part_name" to expressions in the part "new_part_name".


Created in NX4.0.0.

License requirements : None

Parameters
oldPartNamePart name whose references are being replaced
newPartNameNew part name to reference
void NXOpen::ExpressionCollection::ChangeInterpartReferences ( const char *  oldPartName,
const char *  newPartName 
)

Changes all of the references in the part "owning_part" from expressions in the part "old_part_name" to expressions in the part "new_part_name".


Created in NX4.0.0.

License requirements : None

Parameters
oldPartNamePart name whose references are being replaced
newPartNameNew part name to reference
void NXOpen::ExpressionCollection::ChangeInterpartReferences ( const NXString oldPartName,
const NXString newPartName,
bool  doUpdate,
bool  doChecking 
)

Changes all of the references in the part "owning_part" from expressions in the part "old_part_name" to expressions in the part "new_part_name".


Created in NX7.5.0.

License requirements : None

Parameters
oldPartNamePart name whose references are being replaced
newPartNameNew part name to reference
doUpdateDo update if true
doCheckingDo checking if true
void NXOpen::ExpressionCollection::ChangeInterpartReferences ( const char *  oldPartName,
const char *  newPartName,
bool  doUpdate,
bool  doChecking 
)

Changes all of the references in the part "owning_part" from expressions in the part "old_part_name" to expressions in the part "new_part_name".


Created in NX7.5.0.

License requirements : None

Parameters
oldPartNamePart name whose references are being replaced
newPartNameNew part name to reference
doUpdateDo update if true
doCheckingDo checking if true
NXOpen::Expression* NXOpen::ExpressionCollection::Create ( const NXString string)

Creates an expression.

Returns
the new expression
Created in NX3.0.0.

License requirements : None
Parameters
stringthe equation for the expression. Must be in the format: name = right_hand_side. For example, "x = 1.2 * y + z".
NXOpen::Expression* NXOpen::ExpressionCollection::Create ( const char *  string)

Creates an expression.

Returns
the new expression
Created in NX3.0.0.

License requirements : None
Parameters
stringthe equation for the expression. Must be in the format: name = right_hand_side. For example, "x = 1.2 * y + z".
NXOpen::Expression* NXOpen::ExpressionCollection::CreateExpression ( const NXString expressionType,
const NXString string 
)

Creates an expression of the specified type.

Returns
the new expression
Created in NX5.0.0.

License requirements : None
Parameters
expressionTypeThe type of the expression, such as "Number", "String", "Boolean", "Integer", "Point" and "Vector"
stringthe equation for the expression. Must be in the format: name = right_hand_side. For example, "x = 1.2 * y + z".
NXOpen::Expression* NXOpen::ExpressionCollection::CreateExpression ( const char *  expressionType,
const char *  string 
)

Creates an expression of the specified type.

Returns
the new expression
Created in NX5.0.0.

License requirements : None
Parameters
expressionTypeThe type of the expression, such as "Number", "String", "Boolean", "Integer", "Point" and "Vector"
stringthe equation for the expression. Must be in the format: name = right_hand_side. For example, "x = 1.2 * y + z".
NXOpen::InterpartExpressionsBuilder* NXOpen::ExpressionCollection::CreateInterpartExpressionsBuilder ( )

Creates interpart expressions.

Returns

Created in NX8.5.0.

License requirements : None
NXOpen::ReplaceExpressionsBuilder* NXOpen::ExpressionCollection::CreateReplaceExpressionsBuilder ( )

Replace expressions.

Returns

Created in NX10.0.0.

License requirements : None
NXOpen::SuppressByExpressionBuilder* NXOpen::ExpressionCollection::CreateSuppressByExpressionBuilder ( )

Creates a NXOpen::SuppressByExpressionBuilder.

Returns
SuppressByExpressionBuilder object
Created in NX5.0.0.

License requirements : None
NXOpen::Expression* NXOpen::ExpressionCollection::CreateSystemExpression ( const NXString string)

Creates a system expression.

After creating a system expression, you should associate it with an object, such as a sketch dimension. System expressions are deleted when the object they are associated with is deleted.

Returns
the new expression
Created in NX3.0.0.

License requirements : None
Parameters
stringthe equation or right-hand-side for the expression. You can specify a name for the equation by providing a string in the format: name = right_hand_side. For example, "x = 1.2 * y + z". If you do not provide a name, a name will be assigned automatically. For example, if the string is "1.2 * y + z", a name will be assigned automatically.
NXOpen::Expression* NXOpen::ExpressionCollection::CreateSystemExpression ( const char *  string)

Creates a system expression.

After creating a system expression, you should associate it with an object, such as a sketch dimension. System expressions are deleted when the object they are associated with is deleted.

Returns
the new expression
Created in NX3.0.0.

License requirements : None
Parameters
stringthe equation or right-hand-side for the expression. You can specify a name for the equation by providing a string in the format: name = right_hand_side. For example, "x = 1.2 * y + z". If you do not provide a name, a name will be assigned automatically. For example, if the string is "1.2 * y + z", a name will be assigned automatically.
NXOpen::Expression* NXOpen::ExpressionCollection::CreateSystemExpression ( const NXString expressionType,
const NXString string 
)

Creates a system expression of the specified type.

After creating a system expression, you should associate it with an object, such as a sketch dimension. System expressions are deleted when the object they are associated with is deleted.

Returns
the new expression
Created in NX5.0.0.

License requirements : None
Parameters
expressionTypeThe type of the expression, such as "Number", "String", "Boolean", "Integer", "Point" and "Vector"
stringthe equation or right-hand-side for the expression. You can specify a name for the equation by providing a string in the format: name = right_hand_side. For example, "x = 1.2 * y + z". If you do not provide a name, a name will be assigned automatically. For example, if the string is "1.2 * y + z", a name will be assigned automatically.
NXOpen::Expression* NXOpen::ExpressionCollection::CreateSystemExpression ( const char *  expressionType,
const char *  string 
)

Creates a system expression of the specified type.

After creating a system expression, you should associate it with an object, such as a sketch dimension. System expressions are deleted when the object they are associated with is deleted.

Returns
the new expression
Created in NX5.0.0.

License requirements : None
Parameters
expressionTypeThe type of the expression, such as "Number", "String", "Boolean", "Integer", "Point" and "Vector"
stringthe equation or right-hand-side for the expression. You can specify a name for the equation by providing a string in the format: name = right_hand_side. For example, "x = 1.2 * y + z". If you do not provide a name, a name will be assigned automatically. For example, if the string is "1.2 * y + z", a name will be assigned automatically.
NXOpen::Expression* NXOpen::ExpressionCollection::CreateSystemExpressionFromReferenceString ( const NXString reference)

Creates a system string expression from a reference string in Drafting Note format.

Only expressions (X) and attributes (W) are supported.

Here is how the control character sequences need to be formatted: Expressions - Xm.n@exp_name Part Attributes - W@attr_title Object Attributes - W!obj_id@attr_title

Returns
the new expression
Created in NX7.5.0.

License requirements : None
Parameters
referencethe reference string in Drafting Note format
NXOpen::Expression* NXOpen::ExpressionCollection::CreateSystemExpressionFromReferenceString ( const char *  reference)

Creates a system string expression from a reference string in Drafting Note format.

Only expressions (X) and attributes (W) are supported.

Here is how the control character sequences need to be formatted: Expressions - Xm.n@exp_name Part Attributes - W@attr_title Object Attributes - W!obj_id@attr_title

Returns
the new expression
Created in NX7.5.0.

License requirements : None
Parameters
referencethe reference string in Drafting Note format
NXOpen::Expression* NXOpen::ExpressionCollection::CreateSystemExpressionWithUnits ( const NXString string,
NXOpen::Unit unitType 
)

Creates a system expression with units.

After creating a system expression, you should associate it with an object, such as a sketch dimension. System expressions are deleted when the object they are associated with is deleted.

Returns
the new expression
Created in NX4.0.0.

License requirements : None
Parameters
stringthe equation or right-hand-side for the expression. You can specify a name for the equation by providing a string in the format: name = right_hand_side. For example, "x = 1.2 * y + z". If you do not provide a name, a name will be assigned automatically. For example, if the string is "1.2 * y + z", a name will be assigned automatically.
unitTypeunits for the expression
NXOpen::Expression* NXOpen::ExpressionCollection::CreateSystemExpressionWithUnits ( const char *  string,
NXOpen::Unit unitType 
)

Creates a system expression with units.

After creating a system expression, you should associate it with an object, such as a sketch dimension. System expressions are deleted when the object they are associated with is deleted.

Returns
the new expression
Created in NX4.0.0.

License requirements : None
Parameters
stringthe equation or right-hand-side for the expression. You can specify a name for the equation by providing a string in the format: name = right_hand_side. For example, "x = 1.2 * y + z". If you do not provide a name, a name will be assigned automatically. For example, if the string is "1.2 * y + z", a name will be assigned automatically.
unitTypeunits for the expression
NXOpen::Expression* NXOpen::ExpressionCollection::CreateWithUnits ( const NXString string,
NXOpen::Unit unitType 
)

Creates an expression with units.

Returns
the new expression
Created in NX4.0.0.

License requirements : None
Parameters
stringthe equation for the expression. Must be in the format: name = right_hand_side. For example, "x = 1.2 * y + z".
unitTypeunits for the expression
NXOpen::Expression* NXOpen::ExpressionCollection::CreateWithUnits ( const char *  string,
NXOpen::Unit unitType 
)

Creates an expression with units.

Returns
the new expression
Created in NX4.0.0.

License requirements : None
Parameters
stringthe equation for the expression. Must be in the format: name = right_hand_side. For example, "x = 1.2 * y + z".
unitTypeunits for the expression
void NXOpen::ExpressionCollection::Delete ( NXOpen::Expression expression)

Deletes an expression
Created in NX4.0.0.



License requirements : None

Parameters
expressionThe expression to be deleted
void NXOpen::ExpressionCollection::Edit ( NXOpen::Expression expression,
const NXString newRightHandSide 
)

Edits an expression.

Note, there is no difference between this method and editing the expression via NXOpen::Expression::SetRightHandSide if the ExpressionCollection is owned by the part that owns the expression.
Created in NX3.0.0.

License requirements : None

Parameters
expressionThe expression to be edited, Note: if this expression is not owned by the part that owns the ExpressionCollection, a new expression will be created in the part that owns the ExpressionCollection
newRightHandSideWhat you want to change the expression to
void NXOpen::ExpressionCollection::Edit ( NXOpen::Expression expression,
const char *  newRightHandSide 
)

Edits an expression.

Note, there is no difference between this method and editing the expression via NXOpen::Expression::SetRightHandSide if the ExpressionCollection is owned by the part that owns the expression.
Created in NX3.0.0.

License requirements : None

Parameters
expressionThe expression to be edited, Note: if this expression is not owned by the part that owns the ExpressionCollection, a new expression will be created in the part that owns the ExpressionCollection
newRightHandSideWhat you want to change the expression to
void NXOpen::ExpressionCollection::EditWithUnits ( NXOpen::Expression expression,
NXOpen::Unit unitType,
const NXString newRightHandSide 
)

Edits an expression with units.

Changing the units on an existing expression is only allowed when the expression is not referenced yet.


Note, if you do not change the units, there is no difference between this method and editing the expression via NXOpen::Expression::SetRightHandSide if the ExpressionCollection is owned by the part that owns the expression.

Created in NX4.0.0.

License requirements : None

Parameters
expressionThe expression to be edited, Note: if this expression is not owned by the part that owns the ExpressionCollection, a new expression will be created in the part that owns the ExpressionCollection
unitTypeunits for the expression
newRightHandSideWhat you want to change the expression to
void NXOpen::ExpressionCollection::EditWithUnits ( NXOpen::Expression expression,
NXOpen::Unit unitType,
const char *  newRightHandSide 
)

Edits an expression with units.

Changing the units on an existing expression is only allowed when the expression is not referenced yet.


Note, if you do not change the units, there is no difference between this method and editing the expression via NXOpen::Expression::SetRightHandSide if the ExpressionCollection is owned by the part that owns the expression.

Created in NX4.0.0.

License requirements : None

Parameters
expressionThe expression to be edited, Note: if this expression is not owned by the part that owns the ExpressionCollection, a new expression will be created in the part that owns the ExpressionCollection
unitTypeunits for the expression
newRightHandSideWhat you want to change the expression to
iterator NXOpen::ExpressionCollection::end ( )

Returns an iterator addressing one past the last element.

void NXOpen::ExpressionCollection::ExportToFile ( NXOpen::ExpressionCollection::ExportMode  exportMode,
const NXString fileName,
NXOpen::ExpressionCollection::SortType  sortType 
)

Exports the expressions to a text file, or, if 'file_name' is NULL, list the expressions in the listing window.

Throws an exception if there is any error.
NOTE: if the file already exists, an exception is thrown and the file is not overwritten.

Created in NX4.0.0.

License requirements : None

Parameters
exportModeexport mode
fileNameFile name specification to export expressions into.
sortTypeHow to sort the exported expressions
void NXOpen::ExpressionCollection::ExportToFile ( NXOpen::ExpressionCollection::ExportMode  exportMode,
const char *  fileName,
NXOpen::ExpressionCollection::SortType  sortType 
)

Exports the expressions to a text file, or, if 'file_name' is NULL, list the expressions in the listing window.

Throws an exception if there is any error.
NOTE: if the file already exists, an exception is thrown and the file is not overwritten.

Created in NX4.0.0.

License requirements : None

Parameters
exportModeexport mode
fileNameFile name specification to export expressions into.
sortTypeHow to sort the exported expressions
NXOpen::Expression* NXOpen::ExpressionCollection::FindObject ( const NXString journalIdentifier)

Finds the NXOpen::Expression with the given identifier as recorded in a journal.

An object may not return the same value as its JournalIdentifier in different versions of the software. However newer versions of the software should find the same object when FindObject is passed older versions of its journal identifier. In general, this method should not be used in handwritten code and exists to support record and playback of journals.

An exception will be thrown if no object can be found with the given journal identifier.

Returns
Expression found
Created in NX3.0.0.

License requirements : None
Parameters
journalIdentifierIdentifier to be found
NXOpen::Expression* NXOpen::ExpressionCollection::FindObject ( const char *  journalIdentifier)

Finds the NXOpen::Expression with the given identifier as recorded in a journal.

An object may not return the same value as its JournalIdentifier in different versions of the software. However newer versions of the software should find the same object when FindObject is passed older versions of its journal identifier. In general, this method should not be used in handwritten code and exists to support record and playback of journals.

An exception will be thrown if no object can be found with the given journal identifier.

Returns
Expression found
Created in NX3.0.0.

License requirements : None
Parameters
journalIdentifierIdentifier to be found
NXOpen::Expression* NXOpen::ExpressionCollection::GetAttributeExpression ( NXOpen::NXObject object,
const NXString title,
NXOpen::NXObject::AttributeType  type,
int  index 
)

Get the attribute expression of the specified attribute title/type.

Returns
the attribute expression
Created in NX8.0.0.

License requirements : None
Parameters
objectThe object of the attribute
titleThe title of the attribute
typeThe type of the attribute
indexThe array index if the attribute is an array (use -1 otherwise)
NXOpen::Expression* NXOpen::ExpressionCollection::GetAttributeExpression ( NXOpen::NXObject object,
const char *  title,
NXOpen::NXObject::AttributeType  type,
int  index 
)

Get the attribute expression of the specified attribute title/type.

Returns
the attribute expression
Created in NX8.0.0.

License requirements : None
Parameters
objectThe object of the attribute
titleThe title of the attribute
typeThe type of the attribute
indexThe array index if the attribute is an array (use -1 otherwise)
std::vector<NXString> NXOpen::ExpressionCollection::GetInterpartReferences ( )

Returns a list of parts that are referenced from expressions in the part "owning_part".

Returns
array of part names
Created in NX4.0.0.

License requirements : None
void NXOpen::ExpressionCollection::GetInterpartReferencesWithDisplayNames ( std::vector< NXString > &  referencedPartNames,
std::vector< NXString > &  referencedDispNames 
)

Returns a list of parts that are referenced from expressions in the part "owning_part".


Created in NX10.0.0.

License requirements : None

Parameters
referencedPartNamesarray of internal part names
referencedDispNamesarray of display part names
std::vector<NXOpen::Expression *> NXOpen::ExpressionCollection::GetVisibleExpressions ( )

Returns an array of visible "Number" expressions in the part.

Returns
array of "Number" expressions
Created in NX4.0.0.

License requirements : None
void NXOpen::ExpressionCollection::ImportFromFile ( const NXString fileName,
NXOpen::ExpressionCollection::ImportMode  importMode,
bool *  expModified,
std::vector< NXString > &  errorMessages 
)

Imports expressions from a file.

Input a file specification. When calling this method, changes are not applied to the system until Update::DoUpdate is called.
Created in NX4.0.0.

License requirements : None

Parameters
fileNameFile name specification to import expressions from
importModeimport mode
expModifiedTRUE if any expressions were affected by the import
errorMessagestranslated list of error messages
void NXOpen::ExpressionCollection::ImportFromFile ( const char *  fileName,
NXOpen::ExpressionCollection::ImportMode  importMode,
bool *  expModified,
std::vector< NXString > &  errorMessages 
)

Imports expressions from a file.

Input a file specification. When calling this method, changes are not applied to the system until Update::DoUpdate is called.
Created in NX4.0.0.

License requirements : None

Parameters
fileNameFile name specification to import expressions from
importModeimport mode
expModifiedTRUE if any expressions were affected by the import
errorMessagestranslated list of error messages
bool NXOpen::ExpressionCollection::RemoveInterpartReferences ( const NXString partName)

Removes the interpart references from a part.

If a part name is given, then it removes the references to that part. If part_name is NULL, it removes all references to all parts.


References on the RHS are replaced by a numerical value, References on the LHS are deleted. E.g.


x = comp::len + z –> x = 3 + z


comp::height=5 –> (deleted)


The function returns TRUE is any references were removed, and FALSE otherwise.

Returns
whether any changes were made
Created in NX4.0.0.

License requirements : None
Parameters
partNamePart name to remove references for
bool NXOpen::ExpressionCollection::RemoveInterpartReferences ( const char *  partName)

Removes the interpart references from a part.

If a part name is given, then it removes the references to that part. If part_name is NULL, it removes all references to all parts.


References on the RHS are replaced by a numerical value, References on the LHS are deleted. E.g.


x = comp::len + z –> x = 3 + z


comp::height=5 –> (deleted)


The function returns TRUE is any references were removed, and FALSE otherwise.

Returns
whether any changes were made
Created in NX4.0.0.

License requirements : None
Parameters
partNamePart name to remove references for
void NXOpen::ExpressionCollection::Rename ( NXOpen::Expression expression,
const NXString newName 
)

Changes the name of the expression.


Created in NX4.0.0.

License requirements : None

Parameters
expressionexpression to be renamed
newNamenew name of the expression
void NXOpen::ExpressionCollection::Rename ( NXOpen::Expression expression,
const char *  newName 
)

Changes the name of the expression.


Created in NX4.0.0.

License requirements : None

Parameters
expressionexpression to be renamed
newNamenew name of the expression
void NXOpen::ExpressionCollection::Replace ( const NXString currentName,
const NXString replaceName 
)

Replaces references to an expression with another expression.


Created in NX10.0.0.

License requirements : None

Parameters
currentNamecurrent expression name
replaceNamereplace expression name
void NXOpen::ExpressionCollection::Replace ( const char *  currentName,
const char *  replaceName 
)

Replaces references to an expression with another expression.


Created in NX10.0.0.

License requirements : None

Parameters
currentNamecurrent expression name
replaceNamereplace expression name
void NXOpen::ExpressionCollection::ReplaceAttributeExpression ( NXOpen::Expression expression,
NXOpen::NXObject object,
const NXString title,
NXOpen::NXObject::AttributeType  type,
int  index 
)

Replace the attribute expression of the specified attribute title/type.


Created in NX8.0.0.

License requirements : None

Parameters
expressionthe attribute expression
objectThe object of the attribute
titleThe title of the attribute
typeThe type of the attribute
indexThe array index if the attribute is an array (use -1 otherwise)
void NXOpen::ExpressionCollection::ReplaceAttributeExpression ( NXOpen::Expression expression,
NXOpen::NXObject object,
const char *  title,
NXOpen::NXObject::AttributeType  type,
int  index 
)

Replace the attribute expression of the specified attribute title/type.


Created in NX8.0.0.

License requirements : None

Parameters
expressionthe attribute expression
objectThe object of the attribute
titleThe title of the attribute
typeThe type of the attribute
indexThe array index if the attribute is an array (use -1 otherwise)
void NXOpen::ExpressionCollection::SystemRename ( NXOpen::Expression expression,
const NXString newName 
)

Changes the name of the expression without marking system expressions as user expressions.


Created in NX6.0.0.

License requirements : None

Parameters
expressionexpression to be renamed
newNamenew name of the expression
void NXOpen::ExpressionCollection::SystemRename ( NXOpen::Expression expression,
const char *  newName 
)

Changes the name of the expression without marking system expressions as user expressions.


Created in NX6.0.0.

License requirements : None

Parameters
expressionexpression to be renamed
newNamenew name of the expression
tag_t NXOpen::ExpressionCollection::Tag ( ) const

Returns the tag of this object.


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