NXOpen .NET Reference Guide  1899
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties
Public Types | Public Member Functions | Protected Member Functions | Properties | List of all members
NXOpen.ExpressionCollection Class Reference

Represents a collection of expressions. More...

Inheritance diagram for NXOpen.ExpressionCollection:
NXOpen.TaggedObjectCollection NXOpen.Utilities.NXRemotableObject IEnumerable IMessageSink

Public Types

enum  ExportMode { WorkPart, AllInAssyTree, AllParts }
 Indicates the mode for exporting expressions. More...
 
enum  ImportMode { Replace, DontReplace, DeleteImports }
 Indicates the mode for importing expressions. More...
 
enum  SortType { AlphaNum, TimeStamp, ReverseTimeStamp }
 Indicates the mode for sorting expressions. More...
 
enum  Type {
  All, Attribute, Interpart, Measure,
  System, User, UserAndGeometry, UserExcludeSystem
}
 Identifies the type of expression desired. More...
 

Public Member Functions

unsafe string AskInterpartLhsName (NXOpen.Expression sourceExpression)
 Creates the name for an overriding interpart expression reference. More...
 
unsafe string AskInterpartRhsName (NXOpen.Expression sourceExpression)
 Creates the formula for an interpart expression reference. More...
 
unsafe void ChangeInterpartReferences (string oldPartName, string 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...
 
unsafe void ChangeInterpartReferences (string oldPartName, string 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...
 
unsafe void ChangeInterpartReferencesFor4gd (NXOpen.Assemblies.Component targetPartOccTag, string oldSourcePartName, NXOpen.Assemblies.Component newSourcePartOccTag, bool doUpdate, bool doChecking)
 Interface for collaborative design More...
 
unsafe NXOpen.Expression Create (string expressionString)
 Creates a unitless number expression. More...
 
unsafe NXOpen.Expression CreateExpression (string expressionType, string expressionString)
 Creates an expression of the specified type. More...
 
unsafe
NXOpen.InterpartExpressionsBuilder 
CreateInterpartExpressionsBuilder ()
 Creates interpart expressions. More...
 
unsafe NXOpen.Expression CreateNumberExpression (string expressionString, NXOpen.Unit unitType)
 Creates a number expression. More...
 
unsafe
NXOpen.ReplaceExpressionsBuilder 
CreateReplaceExpressionsBuilder ()
 Replace expressions. More...
 
unsafe
NXOpen.SuppressByExpressionBuilder 
CreateSuppressByExpressionBuilder ()
 Creates a NXOpen.SuppressByExpressionBuilder More...
 
unsafe NXOpen.Expression CreateSystemExpression (string expressionString)
 Creates a unitless number-type system expression. More...
 
unsafe NXOpen.Expression CreateSystemExpression (string expressionType, string expressionString)
 Creates a system expression of the specified type. More...
 
unsafe NXOpen.Expression CreateSystemExpressionFromReferenceString (string reference)
 Creates a system string expression from a reference string in Drafting Note format. More...
 
unsafe NXOpen.Expression CreateSystemExpressionWithUnits (string expressionString, NXOpen.Unit unitType)
 Creates a system number expression with units. More...
 
unsafe NXOpen.Expression CreateSystemNumberExpression (string expressionString, NXOpen.Unit unitType)
 Creates a system number expression with units. More...
 
unsafe NXOpen.Expression CreateWithUnits (string expressionString, NXOpen.Unit unitType)
 Creates a number expression with units. More...
 
unsafe void Delete (NXOpen.Expression expression)
 Deletes an expression More...
 
unsafe void Edit (NXOpen.Expression expression, string newFormula)
 Edits an expression. More...
 
unsafe void EditExpression (NXOpen.Expression expression, string newFormula)
 Edits an expression. More...
 
unsafe void EditExpressionWithUnits (NXOpen.Expression expression, NXOpen.Unit unitType, string newFormula)
 Edits an expression with units. More...
 
unsafe void EditWithUnits (NXOpen.Expression expression, NXOpen.Unit unitType, string newFormula)
 Edits an expression with units. More...
 
unsafe void ExportToFile (NXOpen.ExpressionCollection.ExportMode exportMode, string fileName, NXOpen.ExpressionCollection.SortType sortType)
 Exports the expressions to a text file, or, if 'file_name' is a null reference (Nothing in Visual Basic), list the expressions in the listing window. More...
 
unsafe NXOpen.Expression FindObject (string journalIdentifier)
 Finds the NXOpen.Expression with the given identifier as recorded in a journal. More...
 
unsafe NXOpen.Expression GetAttributeExpression (NXOpen.NXObject @object, string title, NXOpen.NXObject.AttributeType type, int index)
 Get the attribute expression of the specified attribute title/type. More...
 
unsafe NXOpen.Expression[] GetExpressionsOfType (NXOpen.ExpressionCollection.Type type, bool visibleOnly)
 Returns an array of expressions in the part of the specified NXOpen.ExpressionCollection.Type . More...
 
unsafe string[] GetInterpartReferences ()
 Returns a list of parts that are referenced from expressions in the part "owning_part". More...
 
unsafe void GetInterpartReferencesFor4gd (out string[] referencedPartNames, out string[] referencedDispNames, out NXOpen.NXObject[] referencedParts)
 Interface for collaborative design More...
 
unsafe void GetInterpartReferencesWithDisplayNames (out string[] referencedPartNames, out string[] referencedDispNames)
 Returns a list of parts that are referenced from expressions in the part "owning_part". More...
 
unsafe NXOpen.Expression[] GetVisibleExpressions ()
 Returns an array of visible "Number" expressions in the part. More...
 
unsafe int[] GetWarningsOnExpression (NXOpen.Expression expression, out string[] warningStrings)
 Returns the warning strings generated for an expression More...
 
unsafe void ImportFromFile (string fileName, NXOpen.ExpressionCollection.ImportMode importMode, out bool expModified, out string[] errorMessages)
 Imports expressions from a file. More...
 
unsafe bool RemoveInterpartReferences (string partName)
 Removes the interpart references from a part. More...
 
unsafe void Rename (NXOpen.Expression expression, string newName)
 Changes the name of the expression. More...
 
unsafe void Replace (string currentName, string replaceName)
 Replaces references to an expression with another expression. More...
 
unsafe void ReplaceAttributeExpression (NXOpen.Expression expression, NXOpen.NXObject @object, string title, NXOpen.NXObject.AttributeType type, int index)
 Replace the attribute expression of the specified attribute title/type. More...
 
unsafe void ReplaceRhsInterpartExpression (NXOpen.Expression oldRhsIpe, NXOpen.Expression newRhsIpe)
 Replaces the old interpart expression references with those of the new interpart expression references. More...
 
unsafe void SystemRename (NXOpen.Expression expression, string newName)
 Changes the name of the expression without marking system expressions as user expressions. More...
 
NXOpen.Expression[] ToArray ()
 Returns an array of NXOpen.Expression objects. More...
 
- Public Member Functions inherited from NXOpen.TaggedObjectCollection
IEnumerator GetEnumerator ()
 Returns an enumerator that iterates through a collection. More...
 
- Public Member Functions inherited from NXOpen.Utilities.NXRemotableObject
IMessageCtrl AsyncProcessMessage (IMessage msg, IMessageSink replySink)
 Asynchronously processes the given message. More...
 
IMessage SyncProcessMessage (IMessage msg)
 Synchronously processes the given message. More...
 

Protected Member Functions

override int EnumerateMoveNext (ref Tag currentTag, byte[] state)
 Advances the enumerator to the next element of the collection. More...
 
- Protected Member Functions inherited from NXOpen.TaggedObjectCollection
new void initialize ()
 <exclude> More...
 
- Protected Member Functions inherited from NXOpen.Utilities.NXRemotableObject
void initialize ()
 <exclude> More...
 

Properties

Tag Tag [get]
 Returns the tag of this object. More...
 

Detailed Description

Represents a collection of expressions.

Use NXOpen.ExpressionCollection instead to ensure correct handling of angle-related 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
WorkPart 

All expressions in the given part

AllInAssyTree 

All expressions in the given part, and in its components

AllParts 

All expressions in All parts in the session

Indicates the mode for importing expressions.

Enumerator
Replace 

Overwrite existing expressions if the imported values differ

DontReplace 

Don't overwrite existing expressions.

New expressions are created

DeleteImports 

Delete all expressions in the imported file

Indicates the mode for sorting expressions.

Enumerator
AlphaNum 

Alphabetic order, with numbers in numerical order

TimeStamp 

Creation order - earliest first

ReverseTimeStamp 

Creation order - latest first

Identifies the type of expression desired.

In some cases, the types might overlap. For example, a system expression might also be considered a user expression if the original creator has been deleted from the part.

Enumerator
All 

All types of expressions.

Attribute 

Expresion linked to an attribute.

Interpart 

Interpart Expression.

Measure 

Measure Expression.

System 

System Expression (created by a NX object or through one of the system APIs).

User 

User Expression (not owned directly by an NX object.

UserAndGeometry 

User Expression including geometric expressions.

UserExcludeSystem 

User Expression excluding system expressions.

Member Function Documentation

unsafe string NXOpen.ExpressionCollection.AskInterpartLhsName ( NXOpen.Expression  sourceExpression)
inline

Creates the name for an overriding interpart expression reference.

For example, if the destination part is A and the source expression is X from part B then NX will create/return the expression name for the A::x overriding interpart expression reference.

Created in NX10.0.0

License requirements: None.

Parameters
sourceExpressionexpression in source part
Returns
overriding interpart expression name
unsafe string NXOpen.ExpressionCollection.AskInterpartRhsName ( NXOpen.Expression  sourceExpression)
inline

Creates the formula for an interpart expression reference.

For example, if the destination part is A and the source expression is X from part B then NX will create/return the expression formula for the A::x interpart expression reference.

Created in NX10.0.0

License requirements: None.

Parameters
sourceExpressionexpression in source part
Returns
formula
unsafe void NXOpen.ExpressionCollection.ChangeInterpartReferences ( string  oldPartName,
string  newPartName 
)
inline

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
unsafe void NXOpen.ExpressionCollection.ChangeInterpartReferences ( string  oldPartName,
string  newPartName,
bool  doUpdate,
bool  doChecking 
)
inline

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
unsafe void NXOpen.ExpressionCollection.ChangeInterpartReferencesFor4gd ( NXOpen.Assemblies.Component  targetPartOccTag,
string  oldSourcePartName,
NXOpen.Assemblies.Component  newSourcePartOccTag,
bool  doUpdate,
bool  doChecking 
)
inline

Interface for collaborative design

Created in NX11.0.0

License requirements: None.

Parameters
targetPartOccTagPart occ of target part
oldSourcePartNamePart name whose references are being replaced
newSourcePartOccTagPart occ of new source part
doUpdateDo update if true
doCheckingDo checking if true
unsafe NXOpen.Expression NXOpen.ExpressionCollection.Create ( string  expressionString)
inline

Creates a unitless number expression.

The formula should likewise be a unitless number.

Created in NX3.0.0

License requirements: None.

Parameters
expressionStringthe expression as a string. Must be in the format: "name = formula". For example, "x = 1.2 * y + z".
Returns
the new expression
unsafe NXOpen.Expression NXOpen.ExpressionCollection.CreateExpression ( string  expressionType,
string  expressionString 
)
inline

Creates an expression of the specified type.

If the expression is a number, it creates a unitless expression.

Created in NX5.0.0

License requirements: None.

Parameters
expressionTypeThe type of the expression, such as "Number", "String", "Boolean", "Integer", "Point" and "Vector"
expressionStringthe full expression string. Must be in the format: "name = formula". For example, "x = 1.2 * y + z".
Returns
the new expression
unsafe NXOpen.InterpartExpressionsBuilder NXOpen.ExpressionCollection.CreateInterpartExpressionsBuilder ( )
inline

Creates interpart expressions.

Created in NX8.5.0

License requirements: None.

Returns
unsafe NXOpen.Expression NXOpen.ExpressionCollection.CreateNumberExpression ( string  expressionString,
NXOpen.Unit  unitType 
)
inline

Creates a number expression.

The calculated units of the formula must be compatible with the given units for the expression. A unitless expression may be created by setting the units to a null reference (Nothing in Visual Basic). In that case, the formula should also be a unitless number.

Created in NX1847.0.0

License requirements: None.

Parameters
expressionStringThe expression as a string. Must be in the format: "name = formula". For example, "x = 1.2 * y + z".
unitTypeunits for the expression
Returns
the new expression
unsafe NXOpen.ReplaceExpressionsBuilder NXOpen.ExpressionCollection.CreateReplaceExpressionsBuilder ( )
inline

Replace expressions.

Created in NX10.0.0

License requirements: None.

Returns
unsafe NXOpen.SuppressByExpressionBuilder NXOpen.ExpressionCollection.CreateSuppressByExpressionBuilder ( )
inline

Creates a NXOpen.SuppressByExpressionBuilder

Created in NX5.0.0

License requirements: None.

Returns
SuppressByExpressionBuilder object
unsafe NXOpen.Expression NXOpen.ExpressionCollection.CreateSystemExpression ( string  expressionString)
inline

Creates a unitless number-type system expression.

The calculated units of the formula should likewise be unitless. 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.

Created in NX3.0.0

License requirements: None.

Parameters
expressionStringthe full expression string or or just the formula for the expression. You can specify a name for the expression by providing an expression string in the format: "name = formula". For example, "x = 1.2 * y + z". If you do not provide a name, a name will be assigned automatically. For example, if the expression string is just the formula "1.2 * y + z", a name will be assigned automatically.
Returns
the new expression
unsafe NXOpen.Expression NXOpen.ExpressionCollection.CreateSystemExpression ( string  expressionType,
string  expressionString 
)
inline

Creates a system expression of the specified type.

If the expression is a number, it creates a unitless expression. The formula should likewise be unitless. 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.

Created in NX5.0.0

License requirements: None.

Parameters
expressionTypeThe type of the expression, such as "Number", "String", "Boolean", "Integer", "Point" and "Vector"
expressionStringthe full expression string or just the formula for the expression. You can specify a name for the equation by providing a expression_string in the format: "name = formula". For example, "x = 1.2 * y + z". If you do not provide a name, a name will be assigned automatically. For example, if the expression_string is just the formula "1.2 * y + z", a name will be assigned automatically.
Returns
the new expression
unsafe NXOpen.Expression NXOpen.ExpressionCollection.CreateSystemExpressionFromReferenceString ( string  reference)
inline

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 Part Attributes - W Object Attributes - W!obj_id

Created in NX7.5.0

License requirements: None.

Parameters
referencethe reference string in Drafting Note format
Returns
the new expression
unsafe NXOpen.Expression NXOpen.ExpressionCollection.CreateSystemExpressionWithUnits ( string  expressionString,
NXOpen.Unit  unitType 
)
inline

Creates a system number expression with units.

The calculated units of the formula must be compatible with the given units for the expression. A unitless expression may be created by setting the units to a null reference (Nothing in Visual Basic). 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.

NOTE: Avoid this legacy function in new application code. The calculated units of the given formula must generally be compatible with the units of the expression being edited. If the formula is unitless, the value calculated by the formula is assumed to be in the units of the expression.

This function may set a modified equation formula if the expression involves angles: The modification performed by this function can, if needed for some parts, be suppressed by setting the environment variable UGII_KF_DONT_CONVERT_FORMULAS_FOR_RADIAN_UNITS. If the units of the expression and the formula do not have matching angle dimensions then the legacy system required that a conversion factor be applied as follows (no matter what units were used for arcAngle):

arcLength = arcRadius * arcAngle * pi() / 180. units: mm

This is no longer needed and will give wrong results. Expressions are modified on load to remove this conversion factor. However, legacy code may expect to need it and therefore have added it, so this function will remove it before writing it to the expression object. Note that the inverse of the previously needed conversion factor is added. The function does not attempt to actually remove the existing conversion factor text, so the result will be an expression as follows:

arcLength = (arcRadius * arcAngle * pi() / 180.) * (180. / pi()) units: mm

To properly create an expression, use instead CreateSystemNumberExpression with a formula as follows:

arcLength = arcRadius * arcAngle units: mm

Created in NX4.0.0

License requirements: None.

Parameters
expressionStringthe full expression string or just the formula for the expression. You can specify a name for the equation by providing an expression_string in the format: "name = formula". For example, "x = 1.2 * y + z". If you do not provide a name, a name will be assigned automatically. For example, if the expression_string is just the formula "1.2 * y + z", a name will be assigned automatically.
unitTypeunits for the expression
Returns
the new expression
unsafe NXOpen.Expression NXOpen.ExpressionCollection.CreateSystemNumberExpression ( string  expressionString,
NXOpen.Unit  unitType 
)
inline

Creates a system number expression with units.

The units of the expression must be compatible with the calculated units of the formula. A unitless expression can be created by setting the units to a null reference (Nothing in Visual Basic). 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.

Created in NX1847.0.0

License requirements: None.

Parameters
expressionStringthe full expression string or just the formula for the expression. You can specify a name for the equation by providing a expression_string in the format: "name = formula". For example, "x = 1.2 * y + z". If you do not provide a name, a name will be assigned automatically. For example, if the expression_string is just the formula "1.2 * y + z", a name will be assigned automatically.
unitTypeunits for the expression
Returns
the new expression
unsafe NXOpen.Expression NXOpen.ExpressionCollection.CreateWithUnits ( string  expressionString,
NXOpen.Unit  unitType 
)
inline

Creates a number expression with units.

The calculated units of the formula must be compatible with the given units for the expression. A unitless expression may be created by setting the units to a null reference (Nothing in Visual Basic).

NOTE: Avoid this legacy function in new application code. The calculated dimensionality of the given formula must generally match the dimensionality of the expression being edited. If the formula's units are determined to be unitless, then this function will assume that its units match the units of the expression.

This function may set a modified equation formula if the expression involves angles. The modification performed by this function can, if needed for some parts, be suppressed by setting the environment variable UGII_KF_DONT_CONVERT_FORMULAS_FOR_RADIAN_UNITS. If the units of the expression and the formula do not have matching angle dimensions then the legacy system required that a conversion factor be applied as follows (no matter what units were used for arcAngle):

arcLength = arcRadius * arcAngle * pi() / 180. units: mm

This is no longer needed and, in fact, will give wrong results. Expressions are modified on load to remove this conversion factor. However, legacy code may expect to need it and therefore have added it, so this function will remove it before writing it to the expression object. Note that the inverse of the previously needed conversion factor is added. The function does not attempt to actually remove the existing conversion factor text.

arcLength = (arcRadius * arcAngle * pi() / 180.) * (180. / pi()) units: mm

To properly create an expression, use instead CreateNumberExpression with a formula as follows:

arcLength = arcRadius * arcAngle units: mm

Created in NX4.0.0

License requirements: None.

Parameters
expressionStringThe expression as a string. Must be in the format: "name = formula". For example, "x = 1.2 * y + z".
unitTypeunits for the expression
Returns
the new expression
unsafe void NXOpen.ExpressionCollection.Delete ( NXOpen.Expression  expression)
inline

Deletes an expression

Created in NX4.0.0

License requirements: None.

Parameters
expressionThe expression to be deleted
unsafe void NXOpen.ExpressionCollection.Edit ( NXOpen.Expression  expression,
string  newFormula 
)
inline

Edits an expression.

Note, there is no difference between this method and editing the expression via NXOpen.Expression.RightHandSide if the ExpressionCollection is owned by the part that owns the expression.

NOTE: Avoid using this legacy function for number expression in new application code. The calculated dimensionality of the given formula must generally match the dimensionality of the expression being edited. If the formula is unitless, then the value calculated by the formula is assumed to be in the units of the expression.

This function may set a modified equation formula if the expression involves angles. The modification performed by this function can, if needed for some parts, be suppressed by setting the environment variable UGII_KF_DONT_CONVERT_FORMULAS_FOR_RADIAN_UNITS. If the units of the expression and the formula do not have matching angle dimensions then the legacy system required that a conversion factor be applied as follows (no matter what units were used for arcAngle):

arcLength = arcRadius * arcAngle * pi() / 180. existing units: mm

This is no longer needed and, in fact, will give wrong results. Expressions are modified on load to remove this conversion factor. However, legacy code may expect to need it and therefore have added it, so this function will remove it before writing it to the expression object. Note that the inverse of the previously needed conversion factor is added. The function does not attempt to actually remove the existing conversion factor text.

arcLength = (arcRadius * arcAngle * pi() / 180.) * (180. / pi()) existing units: mm

To properly edit an expression, use instead EditExpression with a formula as follows:

arcLength = arcRadius * arcAngle existing units: mm

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
newFormulaWhat you want to change the formula of the expression to
unsafe void NXOpen.ExpressionCollection.EditExpression ( NXOpen.Expression  expression,
string  newFormula 
)
inline

Edits an expression.

Note: There is no difference between this method and editing the expression via NXOpen.Expression.GetFormula if the ExpressionCollection is owned by the part that owns the expression.

Created in NX1847.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
newFormulaWhat you want to change the formula of the expression to
unsafe void NXOpen.ExpressionCollection.EditExpressionWithUnits ( NXOpen.Expression  expression,
NXOpen.Unit  unitType,
string  newFormula 
)
inline

Edits an expression with units.

The given units as well as the calculated units of the formula must be compatible with the existing units of the expression.

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

Created in NX1847.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
newFormulaWhat you want to change the formula of the the expression to
unsafe void NXOpen.ExpressionCollection.EditWithUnits ( NXOpen.Expression  expression,
NXOpen.Unit  unitType,
string  newFormula 
)
inline

Edits an expression with units.

Changing the units on an existing expression is only allowed when the expression is not referenced yet. The given units as well as the calculated units of the formula must be compatible with the existing units of the expression.

NOTE: Avoid this legacy function in new application code. The calculated dimensionality of the given formula must generally match the dimensionality of the expression being edited. If the formula is unitless, then the value calculated by the formula is assumed to be in the units of the expression.

This function may set a modified equation formula if the expression involves angles. The modification performed by this function can, if needed for some parts, be suppressed by setting the environment variable UGII_KF_DONT_CONVERT_FORMULAS_FOR_RADIAN_UNITS. If the units of the expression and formula do not have matching angle dimensions then the legacy system required that a conversion factor be applied as follows (no matter what units were used for arcAngle):

arcLength = arcRadius * arcAngle * pi() / 180. existing units: mm

This is no longer needed and, in fact, will give wrong results. Expressions are modified on load to remove this conversion factor. However, legacy code may expect to need it and therefore have added it, so this function will remove it before writing it to the expression object. Note that the inverse of the previously needed conversion factor is added. The function does not attempt to actually remove the existing conversion factor text.

arcLength = (arcRadius * arcAngle * pi() / 180.) * (180. / pi()) existing units: mm

To properly edit an expression, use instead EditExpression with a formula as follows:

arcLength = arcRadius * arcAngle existing units: mm

Note, if you do not change the units, there is no difference between this method and editing the expression via NXOpen.Expression.RightHandSide 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
newFormulaWhat you want to change the formula of the the expression to
override int NXOpen.ExpressionCollection.EnumerateMoveNext ( ref Tag  currentTag,
byte[]  state 
)
inlineprotectedvirtual

Advances the enumerator to the next element of the collection.

Implements NXOpen.TaggedObjectCollection.

unsafe void NXOpen.ExpressionCollection.ExportToFile ( NXOpen.ExpressionCollection.ExportMode  exportMode,
string  fileName,
NXOpen.ExpressionCollection.SortType  sortType 
)
inline

Exports the expressions to a text file, or, if 'file_name' is a null reference (Nothing in Visual Basic), 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
unsafe NXOpen.Expression NXOpen.ExpressionCollection.FindObject ( string  journalIdentifier)
inline

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.

Created in NX3.0.0

License requirements: None.

Parameters
journalIdentifierIdentifier to be found
Returns
Expression found
unsafe NXOpen.Expression NXOpen.ExpressionCollection.GetAttributeExpression ( NXOpen.NXObject object,
string  title,
NXOpen.NXObject.AttributeType  type,
int  index 
)
inline

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

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)
Returns
the attribute expression
unsafe NXOpen.Expression [] NXOpen.ExpressionCollection.GetExpressionsOfType ( NXOpen.ExpressionCollection.Type  type,
bool  visibleOnly 
)
inline

Returns an array of expressions in the part of the specified NXOpen.ExpressionCollection.Type .

Created in NX1847.0.0

License requirements: None.

Parameters
typeNXOpen.ExpressionCollection.Type of the expression.
visibleOnlyFister to get only visible expressions.
Returns
array of "Number" expressions
unsafe string [] NXOpen.ExpressionCollection.GetInterpartReferences ( )
inline

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

Created in NX4.0.0

License requirements: None.

Returns
array of part names
unsafe void NXOpen.ExpressionCollection.GetInterpartReferencesFor4gd ( out string[]  referencedPartNames,
out string[]  referencedDispNames,
out NXOpen.NXObject[]  referencedParts 
)
inline

Interface for collaborative design

Created in NX11.0.0

License requirements: None.

Parameters
referencedPartNamesarray of internal part names
referencedDispNamesarray of display part names
referencedPartsarray of occ parts and part occs
unsafe void NXOpen.ExpressionCollection.GetInterpartReferencesWithDisplayNames ( out string[]  referencedPartNames,
out string[]  referencedDispNames 
)
inline

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
unsafe NXOpen.Expression [] NXOpen.ExpressionCollection.GetVisibleExpressions ( )
inline

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

Created in NX4.0.0

License requirements: None.

Returns
array of "Number" expressions
unsafe int [] NXOpen.ExpressionCollection.GetWarningsOnExpression ( NXOpen.Expression  expression,
out string[]  warningStrings 
)
inline

Returns the warning strings generated for an expression

Created in NX1872.0.0

License requirements: None.

Parameters
expressionexpression in part for which warnings are being queried
warningStringsarray of warning strings generated for the input expression
Returns
array of warning codes generated for the input expression
unsafe void NXOpen.ExpressionCollection.ImportFromFile ( string  fileName,
NXOpen.ExpressionCollection.ImportMode  importMode,
out bool  expModified,
out string[]  errorMessages 
)
inline

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
unsafe bool NXOpen.ExpressionCollection.RemoveInterpartReferences ( string  partName)
inline

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 a null reference (Nothing in Visual Basic), 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.

Created in NX4.0.0

License requirements: None.

Parameters
partNamePart name to remove references for
Returns
whether any changes were made
unsafe void NXOpen.ExpressionCollection.Rename ( NXOpen.Expression  expression,
string  newName 
)
inline

Changes the name of the expression.

Created in NX4.0.0

License requirements: None.

Parameters
expressionexpression to be renamed
newNamenew name of the expression
unsafe void NXOpen.ExpressionCollection.Replace ( string  currentName,
string  replaceName 
)
inline

Replaces references to an expression with another expression.

Created in NX10.0.0

License requirements: None.

Parameters
currentNamecurrent expression name
replaceNamereplace expression name
unsafe void NXOpen.ExpressionCollection.ReplaceAttributeExpression ( NXOpen.Expression  expression,
NXOpen.NXObject object,
string  title,
NXOpen.NXObject.AttributeType  type,
int  index 
)
inline

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)
unsafe void NXOpen.ExpressionCollection.ReplaceRhsInterpartExpression ( NXOpen.Expression  oldRhsIpe,
NXOpen.Expression  newRhsIpe 
)
inline

Replaces the old interpart expression references with those of the new interpart expression references.

For example, replacing x="A"x with y="B"y with result in right hand interpart expression x="B"y and expression y=x.

Created in NX11.0.0

License requirements: None.

Parameters
oldRhsIperight hand side interpart expression to be replaced
newRhsIperight hand side interpart expression to be replaced with
unsafe void NXOpen.ExpressionCollection.SystemRename ( NXOpen.Expression  expression,
string  newName 
)
inline

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
NXOpen.Expression [] NXOpen.ExpressionCollection.ToArray ( )
inline

Returns an array of NXOpen.Expression objects.

Property Documentation

Tag NXOpen.ExpressionCollection.Tag
get

Returns the tag of this object.


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