Builder Class

class NXOpen.Builder

Bases: NXOpen.TaggedObject, NXOpen.GeometricUtilities.IComponentBuilder

A Builder is an object that is used to create and edit other objects.

This is an abstract class that provides the basic functionality common to all builders. See the Builder subclasses for details of application-specific builders.

All Builders use a transaction model. A new builder is created, and its methods are called to make changes. These changes are not applied to the session until the NXOpen.Builder.Commit method is invoked.

Once a Builder has been committed, it should be deleted using the NXOpen.Builder.Destroy. Alternatively, any edits made can be discarded by deleting the builder without calling commit.

This is an abstract class, and cannot be instantiated.

New in version NX4.0.0.

Properties

Property Description
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.
GetObject Returns the object currently being edited by this builder.
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.

Method Detail

Commit

Builder.Commit

Commits any edits that have been applied to the builder.

Returns the object being edited, or a new object if the builder is being used in creation mode.

In certain cases this method may not return an object, please consult the particular class’s documentation to see if this method has a different behavior.

Signature Commit()

Returns:The object being edited, or the new object.
Return type:NXOpen.NXObject

New in version NX4.0.0.

License requirements: None.

Destroy

Builder.Destroy

Deletes the builder, and cleans up any objects created by the builder.

This method should always be called when a builder has been committed or is no longer needed.

Signature Destroy()

New in version NX4.0.0.

License requirements: None.

GetCommittedObjects

Builder.GetCommittedObjects

For builders that create more than one object, this method returns the objects that are created by commit.

Signature GetCommittedObjects()

Returns:The objects created by Commit
Return type:list of NXOpen.NXObject

New in version NX6.0.0.

License requirements: None.

GetObject

Builder.GetObject

Returns the object currently being edited by this builder.

If a new object is being created, and the builder has not yet been commited, returns None.

Signature GetObject()

Returns:
Return type:NXOpen.NXObject

New in version NX4.0.0.

License requirements: None.

ShowResults

Builder.ShowResults

Updates the model to reflect the result of an edit to the model for all builders that support showing results.

Signature ShowResults()

New in version NX7.5.0.

License requirements: None.

Validate

Builder.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.