InterpartExpressionsBuilder Class

class NXOpen.InterpartExpressionsBuilder

Bases: NXOpen.Builder

This class creates interpart expressions from the source part to the current work part via the naming rule defined.

To create a new instance of this class, use NXOpen.ExpressionCollection.CreateInterpartExpressionsBuilder()

Default values.

Property Value
NamingRule AddPrefix

New in version NX8.5.0.

Properties

Property Description
BaseString Returns or sets the base string.
NamingRule Returns or sets the naming rule.
ReplaceString Returns or sets the replace string.
Tag Returns the Tag for this object.

Methods

Method Description
Commit Commits any edits that have been applied to the builder.
Destroy Deletes the builder, and cleans up any objects created by the builder.
GetCommittedObjects For builders that create more than one object, this method returns the objects that are created by commit.
GetExpressions Get an array of source expressions.
GetObject Returns the object currently being edited by this builder.
SetExpressions Set an array of source expressions.
SetExpressionsFor4gd Interface for 4gd
ShowResults Updates the model to reflect the result of an edit to the model for all builders that support showing results.
Validate Validate whether the inputs to the component are sufficient for commit to be called.

Enumerations

InterpartExpressionsBuilderNamingRules Enumeration This defines the naming rule used for the name of the expression created in the current work part.

Property Detail

BaseString

InterpartExpressionsBuilder.BaseString

Returns or sets the base string.

This string is used as the prefix for AddPrefix, the suffix for AddSuffix, the replaced string for Replace and the rename string for RenameWithIndex.

-------------------------------------

Getter Method

Signature BaseString

Returns:
Return type:str

New in version NX8.5.0.

License requirements: None.

-------------------------------------

Setter Method

Signature BaseString

Parameters:baseString (str) –

New in version NX8.5.0.

License requirements: None.

NamingRule

InterpartExpressionsBuilder.NamingRule

Returns or sets the naming rule.

This determines how the name of the expression in the current work part is constructed.

-------------------------------------

Getter Method

Signature NamingRule

Returns:
Return type:NXOpen.InterpartExpressionsBuilderNamingRules

New in version NX8.5.0.

License requirements: None.

-------------------------------------

Setter Method

Signature NamingRule

Parameters:namingRule (NXOpen.InterpartExpressionsBuilderNamingRules) –

New in version NX8.5.0.

License requirements: None.

ReplaceString

InterpartExpressionsBuilder.ReplaceString

Returns or sets the replace string.

This string replaces the BaseString for the Replace.

-------------------------------------

Getter Method

Signature ReplaceString

Returns:
Return type:str

New in version NX8.5.0.

License requirements: None.

-------------------------------------

Setter Method

Signature ReplaceString

Parameters:replaceString (str) –

New in version NX8.5.0.

License requirements: None.

Method Detail

GetExpressions

InterpartExpressionsBuilder.GetExpressions

Get an array of source expressions.

These are the source expressions to be referenced by the current work part. The destination names can be used to override the naming rule for a given source expression. This is a parallel array. Each source expression has an entry in this array for its destination name. If the associated destination name is the empty string then the naming rule will be used to generate the destination name for a given source expression otherwise the destination name itself will be used to name the new expression in the current work part.

Signature GetExpressions()

Returns:a tuple
Return type:A tuple consisting of (sourceExpressions, destinationNames). sourceExpressions is a list of NXOpen.Expression. array of source expressions destinationNames is a list of str. array of destination names

New in version NX8.5.0.

License requirements: None.

SetExpressions

InterpartExpressionsBuilder.SetExpressions

Set an array of source expressions.

These are the source expressions to be referenced by the current work part. The destination names can be used to override the naming rule for a given source expression. This is a parallel array. Each source expression has an entry in this array for its destination name. If the associated destination name is the empty string then the naming rule will be used to generate the destination name for a given source expression otherwise the destination name itself will be used to name the new expression in the current work part.

Signature SetExpressions(sourceExpressions, destinationNames)

Parameters:
  • sourceExpressions (list of NXOpen.Expression) – array of source expressions
  • destinationNames (list of str) – array of destination names

New in version NX8.5.0.

License requirements: None.

SetExpressionsFor4gd

InterpartExpressionsBuilder.SetExpressionsFor4gd

Interface for 4gd

Signature SetExpressionsFor4gd(targetPartOcc, sourcePartOcc, sourceExpressions, destinationNames)

Parameters:

New in version NX11.0.0.

License requirements: None.

Validate

InterpartExpressionsBuilder.Validate

Validate whether the inputs to the component are sufficient for commit to be called.

If the component is not in a state to commit then an exception is thrown. For example, if the component requires you to set some property, this method will throw an exception if you haven’t set it. This method throws a not-yet-implemented NXException for some components.

Signature Validate()

Returns:Was self validation successful
Return type:bool

New in version NX3.0.1.

License requirements: None.