NXOpen .NET Reference
12.0.0
|
Represents a collection of expressions. More...
Public Types | |
enum | ImportMode { Replace, DontReplace, DeleteImports } |
Indicates the mode for importing expressions. More... | |
enum | ExportMode { WorkPart, AllInAssyTree, AllParts } |
Indicates the mode for exporting expressions. More... | |
enum | SortType { AlphaNum, TimeStamp, ReverseTimeStamp } |
Indicates the mode for sorting expressions. More... | |
Public Member Functions | |
NXOpen.Expression[] | ToArray () |
Returns an array of NXOpen.Expression objects. More... | |
unsafe NXOpen.Expression | Create (string @string) |
Creates an expression More... | |
unsafe NXOpen.Expression | CreateWithUnits (string @string, NXOpen.Unit unitType) |
Creates an expression with units. More... | |
unsafe NXOpen.Expression | CreateSystemExpression (string @string) |
Creates a system expression. More... | |
unsafe NXOpen.Expression | CreateSystemExpressionWithUnits (string @string, NXOpen.Unit unitType) |
Creates a system expression with units. More... | |
unsafe NXOpen.Expression | CreateExpression (string expressionType, string @string) |
Creates an expression of the specified type. More... | |
unsafe NXOpen.Expression | CreateSystemExpression (string expressionType, string @string) |
Creates a system expression of the specified type. More... | |
unsafe void | Edit (NXOpen.Expression expression, string newRightHandSide) |
Edits an expression. More... | |
unsafe void | EditWithUnits (NXOpen.Expression expression, NXOpen.Unit unitType, string newRightHandSide) |
Edits an expression with units. More... | |
unsafe void | Delete (NXOpen.Expression expression) |
Deletes an expression More... | |
unsafe NXOpen.Expression | FindObject (string journalIdentifier) |
Finds the NXOpen.Expression with the given identifier as recorded in a journal. More... | |
unsafe void | ImportFromFile (string fileName, NXOpen.ExpressionCollection.ImportMode importMode, out bool expModified, out string[] errorMessages) |
Imports expressions from a file. 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 string[] | GetInterpartReferences () |
Returns a list of parts that are referenced from expressions in the part "owning_part". 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 void | GetInterpartReferencesFor4gd (out string[] referencedPartNames, out string[] referencedDispNames, out NXOpen.NXObject[] referencedParts) |
Interface for 4gd More... | |
unsafe bool | RemoveInterpartReferences (string partName) |
Removes the interpart references from a part. 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 4gd More... | |
unsafe NXOpen.Expression[] | GetVisibleExpressions () |
Returns an array of visible "Number" expressions in the part. More... | |
unsafe void | Rename (NXOpen.Expression expression, string newName) |
Changes the name of the expression. More... | |
unsafe void | SystemRename (NXOpen.Expression expression, string newName) |
Changes the name of the expression without marking system expressions as user expressions. More... | |
unsafe void | Replace (string currentName, string replaceName) |
Replaces references to an expression with another expression. More... | |
unsafe NXOpen.SuppressByExpressionBuilder | CreateSuppressByExpressionBuilder () |
Creates a NXOpen.SuppressByExpressionBuilder More... | |
unsafe NXOpen.Expression | CreateSystemExpressionFromReferenceString (string reference) |
Creates a system string expression from a reference string in Drafting Note format. 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 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 NXOpen.InterpartExpressionsBuilder | CreateInterpartExpressionsBuilder () |
Creates interpart expressions. More... | |
unsafe NXOpen.ReplaceExpressionsBuilder | CreateReplaceExpressionsBuilder () |
Replace expressions. More... | |
unsafe string | AskInterpartRhsName (NXOpen.Expression sourceExpression) |
Creates the right hand side name for an interpart expression reference. More... | |
unsafe string | AskInterpartLhsName (NXOpen.Expression sourceExpression) |
Creates the left hand side name for an overriding interpart expression reference. More... | |
unsafe void | ReplaceRhsInterpartExpression (NXOpen.Expression oldRhsIpe, NXOpen.Expression newRhsIpe) |
Replaces the old right hand side interpart expression references with those of the new right hand side interpart expression. More... | |
Protected Member Functions | |
override int | EnumerateMoveNext (ref Tag currentTag, byte[] state) |
Advances the enumerator to the next element of the collection. More... | |
Properties | |
Tag | Tag [get] |
Returns the tag of this object. More... | |
Represents a collection of expressions.
To obtain an instance of this class, refer to NXOpen.BasePart
Created in NX3.0.0
unsafe string NXOpen.ExpressionCollection.AskInterpartLhsName | ( | NXOpen.Expression | sourceExpression | ) |
Creates the left hand side 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 for the A::x overrdding interpart expression reference.
Created in NX10.0.0
License requirements: None.
sourceExpression | expression in source part |
unsafe string NXOpen.ExpressionCollection.AskInterpartRhsName | ( | NXOpen.Expression | sourceExpression | ) |
Creates the right hand side name 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 for the A::x interpart expression reference.
Created in NX10.0.0
License requirements: None.
sourceExpression | expression in source part |
unsafe void NXOpen.ExpressionCollection.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".
Created in NX4.0.0
License requirements: None.
oldPartName | Part name whose references are being replaced |
newPartName | New part name to reference |
unsafe void NXOpen.ExpressionCollection.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".
Created in NX7.5.0
License requirements: None.
oldPartName | Part name whose references are being replaced |
newPartName | New part name to reference |
doUpdate | Do update if true |
doChecking | Do checking if true |
unsafe void NXOpen.ExpressionCollection.ChangeInterpartReferencesFor4gd | ( | NXOpen.Assemblies.Component | targetPartOccTag, |
string | oldSourcePartName, | ||
NXOpen.Assemblies.Component | newSourcePartOccTag, | ||
bool | doUpdate, | ||
bool | doChecking | ||
) |
Interface for 4gd
Created in NX11.0.0
License requirements: None.
targetPartOccTag | Part occ of target part |
oldSourcePartName | Part name whose references are being replaced |
newSourcePartOccTag | Part occ of new source part |
doUpdate | Do update if true |
doChecking | Do checking if true |
unsafe NXOpen.Expression NXOpen.ExpressionCollection.Create | ( | string @ | string | ) |
Creates an expression
Created in NX3.0.0
License requirements: None.
string | the equation for the expression. Must be in the format: name = right_hand_side. For example, "x = 1.2 * y + z". |
unsafe NXOpen.Expression NXOpen.ExpressionCollection.CreateExpression | ( | string | expressionType, |
string @ | string | ||
) |
Creates an expression of the specified type.
Created in NX5.0.0
License requirements: None.
expressionType | The type of the expression, such as "Number", "String", "Boolean", "Integer", "Point" and "Vector" |
string | the equation for the expression. Must be in the format: name = right_hand_side. For example, "x = 1.2 * y + z". |
unsafe NXOpen.InterpartExpressionsBuilder NXOpen.ExpressionCollection.CreateInterpartExpressionsBuilder | ( | ) |
Creates interpart expressions.
Created in NX8.5.0
License requirements: None.
unsafe NXOpen.ReplaceExpressionsBuilder NXOpen.ExpressionCollection.CreateReplaceExpressionsBuilder | ( | ) |
Replace expressions.
Created in NX10.0.0
License requirements: None.
unsafe NXOpen.SuppressByExpressionBuilder NXOpen.ExpressionCollection.CreateSuppressByExpressionBuilder | ( | ) |
Creates a NXOpen.SuppressByExpressionBuilder
Created in NX5.0.0
License requirements: None.
unsafe NXOpen.Expression NXOpen.ExpressionCollection.CreateSystemExpression | ( | string @ | 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.
Created in NX3.0.0
License requirements: None.
string | the 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. |
unsafe NXOpen.Expression NXOpen.ExpressionCollection.CreateSystemExpression | ( | string | expressionType, |
string @ | 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.
Created in NX5.0.0
License requirements: None.
expressionType | The type of the expression, such as "Number", "String", "Boolean", "Integer", "Point" and "Vector" |
string | the 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. |
unsafe NXOpen.Expression NXOpen.ExpressionCollection.CreateSystemExpressionFromReferenceString | ( | string | 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 Part Attributes - W Object Attributes - W!obj_id
Created in NX7.5.0
License requirements: None.
reference | the reference string in Drafting Note format |
unsafe NXOpen.Expression NXOpen.ExpressionCollection.CreateSystemExpressionWithUnits | ( | string @ | 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.
Created in NX4.0.0
License requirements: None.
string | the 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. |
unitType | units for the expression |
unsafe NXOpen.Expression NXOpen.ExpressionCollection.CreateWithUnits | ( | string @ | string, |
NXOpen.Unit | unitType | ||
) |
Creates an expression with units.
Created in NX4.0.0
License requirements: None.
string | the equation for the expression. Must be in the format: name = right_hand_side. For example, "x = 1.2 * y + z". |
unitType | units for the expression |
unsafe void NXOpen.ExpressionCollection.Delete | ( | NXOpen.Expression | expression | ) |
Deletes an expression
Created in NX4.0.0
License requirements: None.
expression | The expression to be deleted |
unsafe void NXOpen.ExpressionCollection.Edit | ( | NXOpen.Expression | expression, |
string | newRightHandSide | ||
) |
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.
Created in NX3.0.0
License requirements: None.
expression | The 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 |
newRightHandSide | What you want to change the expression to |
unsafe void NXOpen.ExpressionCollection.EditWithUnits | ( | NXOpen.Expression | expression, |
NXOpen.Unit | unitType, | ||
string | 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.RightHandSide if the ExpressionCollection is owned by the part that owns the expression.
Created in NX4.0.0
License requirements: None.
expression | The 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 |
unitType | units for the expression |
newRightHandSide | What you want to change the expression to |
|
protected |
Advances the enumerator to the next element of the collection.
unsafe void NXOpen.ExpressionCollection.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.
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.
exportMode | export mode |
fileName | File name specification to export expressions into. |
sortType | How to sort the exported expressions |
unsafe NXOpen.Expression NXOpen.ExpressionCollection.FindObject | ( | string | 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.
Created in NX3.0.0
License requirements: None.
journalIdentifier | Identifier to be found |
unsafe NXOpen.Expression NXOpen.ExpressionCollection.GetAttributeExpression | ( | NXOpen.NXObject @ | object, |
string | title, | ||
NXOpen.NXObject.AttributeType | type, | ||
int | index | ||
) |
Get the attribute expression of the specified attribute title/type.
Created in NX8.0.0
License requirements: None.
object | The object of the attribute |
title | The title of the attribute |
type | The type of the attribute |
index | The array index if the attribute is an array (use -1 otherwise) |
unsafe string [] NXOpen.ExpressionCollection.GetInterpartReferences | ( | ) |
Returns a list of parts that are referenced from expressions in the part "owning_part".
Created in NX4.0.0
License requirements: None.
unsafe void NXOpen.ExpressionCollection.GetInterpartReferencesFor4gd | ( | out string[] | referencedPartNames, |
out string[] | referencedDispNames, | ||
out NXOpen.NXObject[] | referencedParts | ||
) |
Interface for 4gd
Created in NX11.0.0
License requirements: None.
referencedPartNames | array of internal part names |
referencedDispNames | array of display part names |
referencedParts | array of occ parts and part occs |
unsafe void NXOpen.ExpressionCollection.GetInterpartReferencesWithDisplayNames | ( | out string[] | referencedPartNames, |
out string[] | referencedDispNames | ||
) |
Returns a list of parts that are referenced from expressions in the part "owning_part".
Created in NX10.0.0
License requirements: None.
referencedPartNames | array of internal part names |
referencedDispNames | array of display part names |
unsafe NXOpen.Expression [] NXOpen.ExpressionCollection.GetVisibleExpressions | ( | ) |
Returns an array of visible "Number" expressions in the part.
Created in NX4.0.0
License requirements: None.
unsafe void NXOpen.ExpressionCollection.ImportFromFile | ( | string | fileName, |
NXOpen.ExpressionCollection.ImportMode | importMode, | ||
out bool | expModified, | ||
out string[] | 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.
fileName | File name specification to import expressions from |
importMode | import mode |
expModified | TRUE if any expressions were affected by the import |
errorMessages | translated list of error messages |
unsafe bool NXOpen.ExpressionCollection.RemoveInterpartReferences | ( | string | 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 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.
partName | Part name to remove references for |
unsafe void NXOpen.ExpressionCollection.Rename | ( | NXOpen.Expression | expression, |
string | newName | ||
) |
Changes the name of the expression.
Created in NX4.0.0
License requirements: None.
expression | expression to be renamed |
newName | new name of the expression |
unsafe void NXOpen.ExpressionCollection.Replace | ( | string | currentName, |
string | replaceName | ||
) |
Replaces references to an expression with another expression.
Created in NX10.0.0
License requirements: None.
currentName | current expression name |
replaceName | replace expression name |
unsafe void NXOpen.ExpressionCollection.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.
Created in NX8.0.0
License requirements: None.
expression | the attribute expression |
object | The object of the attribute |
title | The title of the attribute |
type | The type of the attribute |
index | The array index if the attribute is an array (use -1 otherwise) |
unsafe void NXOpen.ExpressionCollection.ReplaceRhsInterpartExpression | ( | NXOpen.Expression | oldRhsIpe, |
NXOpen.Expression | newRhsIpe | ||
) |
Replaces the old right hand side interpart expression references with those of the new right hand side interpart expression.
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.
oldRhsIpe | right hand side interpart expression to be replaced |
newRhsIpe | right hand side interpart expression to be replaced with |
unsafe void NXOpen.ExpressionCollection.SystemRename | ( | NXOpen.Expression | expression, |
string | newName | ||
) |
Changes the name of the expression without marking system expressions as user expressions.
Created in NX6.0.0
License requirements: None.
expression | expression to be renamed |
newName | new name of the expression |
NXOpen.Expression [] NXOpen.ExpressionCollection.ToArray | ( | ) |
Returns an array of NXOpen.Expression objects.
|
get |
Returns the tag of this object.