PartOperationBuilder Class¶
-
class
NXOpen.PDM.
PartOperationBuilder
¶ Bases:
NXOpen.Builder
,NXOpen.IAttributeSourceObjectBuilder
Represents a builder class that performs various design element operations.
The operation can be one of
NXOpen.PDM.PartOperationBuilderOperationType
To create a new instance of this class, useNXOpen.PDM.PdmSession.CreateOperationBuilder()
New in version NX9.0.0.
Properties¶
Property | Description |
---|---|
DefaultDestinationFolder | Returns or sets the default destination folder string for the part being created . |
DependentFileSaveAsOption | Returns or sets the Dependent files Save As option. |
ReplaceAllComponents | Returns or sets the replace all components. |
Tag | Returns the Tag for this object. |
Methods¶
Method | Description |
---|---|
AddRelatedPartToOperate | Add related part to the part undergoing an operation. |
AutoAssignAttributes | Auto assigns the attributes for a given array of objects and returns an array of objects that failed to auto assign. |
Commit | Commits any edits that have been applied to the builder. |
CreateLogicalObjects | Creates the pre-creation objects for the parts |
CreateNonMasterListForLogicalObject | Create NonMaster list for the selected logical Object |
CreateSpecificationsForLogicalObjects | Create new specifications for Logical Objects |
Destroy | Deletes the builder, and cleans up any objects created by the builder. |
EditNonMasterName | Sets the name the non-master part will get saved as. |
GetAlternateIDManager | Create an instance of a NXOpen.PDM.AlternateIdManager class that will be used to create alternate ID information while creating the new part. |
GetCommittedObjects | For builders that create more than one object, this method returns the objects that are created by commit. |
GetDialogOperation | Returns the dialog operation Applicable only for operation types PartOperationBuilderOperationType.SaveAs and PartOperationBuilderOperationType.Revise @return |
GetNonMasterCopyOption | Get the nonmasters saveAs option for given logical object. |
GetNonMasterList | Gets NonMaster list for the given logical Object @return Non-master part file names |
GetObject | Returns the object currently being edited by this builder. |
GetOperationFailures | Returns part operation failures @return |
IsNonMasterBeingCopied | Returns whether or not the non master part specified for the given :py:class:`NXOpen.PDM.LogicalObject`will actually get saved during the save as operation. |
SetDialogOperation | Sets the dialog operation. |
SetNonMasterSaveAsOption | Set the nonmasters saveAs option for given logical object |
SetSelectedNonMasterToSaveAs | Sets whether or not the non-master part specified will actually get saved during the save as operation. |
SetSelectedParts | Sets the selected parts. |
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. |
ValidateLogicalObjectsToCommit | Validates NXOpen.PDM.LogicalObject objects with this builder and udpates the operation failuers. |
Enumerations¶
PartOperationBuilderDependentFileSaveAs Enumeration | This enum is used to specify which dependent files should be saved during the save as operation. |
PartOperationBuilderNonMasterSaveAs Enumeration | This enum is used to specify which non-master parts should be saved during the save as operation. |
PartOperationBuilderOperationType Enumeration | Represents an operation type that can be performed on a part |
Property Detail¶
DefaultDestinationFolder¶
-
PartOperationBuilder.
DefaultDestinationFolder
¶ Returns or sets the default destination folder string for the part being created .
It will be ignored in case of revise and creation of non-masters. The default destination folder string can be <username>:<folder>:<folder>, or :<folder>:<folder> means username is optional. In case of :<folder>:<folder>, the first : indicates Home, for example, :Newstuff, is the Newstuff folder in current user’s Home container.
-------------------------------------
Getter Method
Signature
DefaultDestinationFolder()
Returns: Return type: str New in version NX10.0.0.
License requirements: None.
-------------------------------------
Setter Method
Signature
DefaultDestinationFolder(defaultDestinationFolder)
Parameters: defaultDestinationFolder (str) – New in version NX10.0.0.
License requirements: None.
DependentFileSaveAsOption¶
-
PartOperationBuilder.
DependentFileSaveAsOption
¶ Returns or sets the Dependent files Save As option.
Save As option can be one of these
PartOperationBuilderDependentFileSaveAs.All
andPartOperationBuilderDependentFileSaveAs.None
-------------------------------------
Getter Method
Signature
DependentFileSaveAsOption()
Returns: Return type: NXOpen.PDM.PartOperationBuilderDependentFileSaveAs
New in version NX9.0.0.
Deprecated since version NX10.0.0: Use
NXOpen.PDM.PartOperationCopyBuilder.DependentFilesToCopyOption()
insteadLicense requirements: None.
-------------------------------------
Setter Method
Signature
DependentFileSaveAsOption(saveOption)
Parameters: saveOption ( NXOpen.PDM.PartOperationBuilderDependentFileSaveAs
) –New in version NX9.0.0.
Deprecated since version NX10.0.0: Use
NXOpen.PDM.PartOperationCopyBuilder.SetDependentFilesToCopyOption()
insteadLicense requirements: None.
ReplaceAllComponents¶
-
PartOperationBuilder.
ReplaceAllComponents
¶ Returns or sets the replace all components.
This option specifies whether part will be replaced or copied. Applicable only for operation types
PartOperationBuilderOperationType.SaveAs
andPartOperationBuilderOperationType.Revise
-------------------------------------
Getter Method
Signature
ReplaceAllComponents()
Returns: Return type: bool New in version NX9.0.0.
Deprecated since version NX10.0.0: Use
NXOpen.PDM.PartOperationCopyBuilder.ReplaceAllComponentsInSession()
insteadLicense requirements: None.
-------------------------------------
Setter Method
Signature
ReplaceAllComponents(replaceAllComponents)
Parameters: replaceAllComponents (bool) – New in version NX9.0.0.
Deprecated since version NX10.0.0: Use
NXOpen.PDM.PartOperationCopyBuilder.SetReplaceAllComponentsInSession()
insteadLicense requirements: None.
Method Detail¶
AutoAssignAttributes¶
-
PartOperationBuilder.
AutoAssignAttributes
¶ Auto assigns the attributes for a given array of objects and returns an array of objects that failed to auto assign.
Signature
AutoAssignAttributes(objects)
Parameters: objects (list of NXOpen.NXObject
) –Returns: Return type: NXOpen.ErrorList
New in version NX8.5.0.
License requirements: None.
CreateLogicalObjects¶
-
PartOperationBuilder.
CreateLogicalObjects
¶ Creates the pre-creation objects for the parts
Signature
CreateLogicalObjects()
Returns: Return type: list of NXOpen.PDM.LogicalObject
New in version NX9.0.0.
License requirements: None.
CreateNonMasterListForLogicalObject¶
-
PartOperationBuilder.
CreateNonMasterListForLogicalObject
¶ Create NonMaster list for the selected logical Object
Signature
CreateNonMasterListForLogicalObject(logicalObject)
Parameters: logicalObject ( NXOpen.PDM.LogicalObject
) –New in version NX9.0.0.
Deprecated since version NX10.0.0: Use
NXOpen.PDM.PartOperationCopyBuilder.CreateNonMasterListForCopyLogicalObject()
insteadLicense requirements: None.
CreateSpecificationsForLogicalObjects¶
-
PartOperationBuilder.
CreateSpecificationsForLogicalObjects
¶ Create new specifications for Logical Objects
Signature
CreateSpecificationsForLogicalObjects(logicalObjects)
Parameters: logicalObjects (list of NXOpen.PDM.LogicalObject
) –New in version NX9.0.0.
License requirements: None.
EditNonMasterName¶
-
PartOperationBuilder.
EditNonMasterName
¶ Sets the name the non-master part will get saved as.
It will get saved as the original non-master name if this method is not called.
Signature
EditNonMasterName(logicalObject, oldName, newName)
Parameters: - logicalObject (
NXOpen.PDM.LogicalObject
) – - oldName (str) – the non-master part whose save as name is being set here
- newName (str) – the new name
Returns: flag to indicate whether the newName is valid
Return type: bool
New in version NX9.0.0.
Deprecated since version NX10.0.0: Use
NXOpen.PDM.PartOperationCopyBuilder.EditNonMasterToCopyName()
insteadLicense requirements: None.
- logicalObject (
GetAlternateIDManager¶
-
PartOperationBuilder.
GetAlternateIDManager
¶ Create an instance of a
NXOpen.PDM.AlternateIdManager
class that will be used to create alternate ID information while creating the new part.CreateSpec call should happen before calling this method.
Signature
GetAlternateIDManager(logicalObject)
Parameters: logicalObject ( NXOpen.PDM.LogicalObject
) –Returns: the new NXOpen.PDM.AlternateIdManager
instanceReturn type: NXOpen.PDM.AlternateIdManager
New in version NX9.0.0.
License requirements: None.
GetDialogOperation¶
-
PartOperationBuilder.
GetDialogOperation
¶ Returns the dialog operation Applicable only for operation types
PartOperationBuilderOperationType.SaveAs
andPartOperationBuilderOperationType.Revise
Signature
GetDialogOperation()
Returns: Return type: NXOpen.PDM.PartOperationBuilderOperationType
New in version NX9.0.0.
License requirements: None.
GetNonMasterCopyOption¶
-
PartOperationBuilder.
GetNonMasterCopyOption
¶ Get the nonmasters saveAs option for given logical object.
Save As option can be one of these
PartOperationBuilderNonMasterSaveAs.All
andPartOperationBuilderNonMasterSaveAs.None
Signature
GetNonMasterCopyOption(logicalObject)
Parameters: logicalObject ( NXOpen.PDM.LogicalObject
) –Returns: Return type: NXOpen.PDM.PartOperationBuilderNonMasterSaveAs
New in version NX9.0.0.
Deprecated since version NX10.0.0: Use
NXOpen.PDM.PartOperationCopyBuilder.GetCopyNonMasterPartsOption()
insteadLicense requirements: None.
GetNonMasterList¶
-
PartOperationBuilder.
GetNonMasterList
¶ Gets NonMaster list for the given logical Object
Signature
GetNonMasterList(logicalObject)
Parameters: logicalObject ( NXOpen.PDM.LogicalObject
) –Returns: Non-master part file names Return type: list of str New in version NX9.0.0.
Deprecated since version NX10.0.0: Use
NXOpen.PDM.PartOperationCopyBuilder.GetNonMasterListForCopyLogicalObject()
insteadLicense requirements: None.
GetOperationFailures¶
-
PartOperationBuilder.
GetOperationFailures
¶ Returns part operation failures
Signature
GetOperationFailures()
Returns: Return type: NXOpen.ErrorList
New in version NX9.0.0.
License requirements: None.
IsNonMasterBeingCopied¶
-
PartOperationBuilder.
IsNonMasterBeingCopied
¶ Returns whether or not the non master part specified for the given :py:class:`NXOpen.PDM.LogicalObject`will actually get saved during the save as operation.
Signature
IsNonMasterBeingCopied(logicalObject, partName)
Parameters: - logicalObject (
NXOpen.PDM.LogicalObject
) – - partName (str) – the non-master part that the caller wants to save or not save
Returns: True means that this non-master will be saved. False means that this non master will not be saved.
Return type: bool
New in version NX9.0.0.
Deprecated since version NX10.0.0: Use
NXOpen.PDM.PartOperationCopyBuilder.IsNonMasterForLogicalObjectBeingCopied()
insteadLicense requirements: None.
- logicalObject (
SetDialogOperation¶
-
PartOperationBuilder.
SetDialogOperation
¶ Sets the dialog operation.
Applicable only for operation types
PartOperationBuilderOperationType.SaveAs
andPartOperationBuilderOperationType.Revise
Signature
SetDialogOperation(dialogOperation)
Parameters: dialogOperation ( NXOpen.PDM.PartOperationBuilderOperationType
) –New in version NX9.0.0.
License requirements: None.
SetNonMasterSaveAsOption¶
-
PartOperationBuilder.
SetNonMasterSaveAsOption
¶ Set the nonmasters saveAs option for given logical object
Signature
SetNonMasterSaveAsOption(logicalObject, saveOption)
Parameters: - logicalObject (
NXOpen.PDM.LogicalObject
) – - saveOption (
NXOpen.PDM.PartOperationBuilderNonMasterSaveAs
) –
New in version NX9.0.0.
Deprecated since version NX10.0.0: Use
NXOpen.PDM.PartOperationCopyBuilder.SetCopyNonMasterPartsOption()
insteadLicense requirements: None.
- logicalObject (
SetSelectedNonMasterToSaveAs¶
-
PartOperationBuilder.
SetSelectedNonMasterToSaveAs
¶ Sets whether or not the non-master part specified will actually get saved during the save as operation.
True means that it will be saved. False means that it will not be saved.
Signature
SetSelectedNonMasterToSaveAs(logicalObject, partName)
Parameters: - logicalObject (
NXOpen.PDM.LogicalObject
) – - partName (str) – the non-master part whose save option is being set here
New in version NX9.0.0.
Deprecated since version NX10.0.0: Use
NXOpen.PDM.PartOperationCopyBuilder.SetSelectedNonMasterToCopy()
insteadLicense requirements: None.
- logicalObject (
SetSelectedParts¶
-
PartOperationBuilder.
SetSelectedParts
¶ Sets the selected parts.
Applicable only for operation types
PartOperationBuilderOperationType.SaveAs
andPartOperationBuilderOperationType.Revise
Also returns an array of parts failed to added, these are not removed from the input array though.NXOpen.PDM.PartOperationBuilder.GetOperationFailures()
can be called to get the errors occurred during this operation.Signature
SetSelectedParts(selectedParts)
Parameters: selectedParts (list of NXOpen.BasePart
) –Returns: Return type: list of NXOpen.BasePart
New in version NX9.0.0.
Deprecated since version NX10.0.0: Use
NXOpen.PDM.PartOperationCopyBuilder.SetSelectedPartsToCopy()
insteadLicense requirements: None.
Validate¶
-
PartOperationBuilder.
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.
ValidateLogicalObjectsToCommit¶
-
PartOperationBuilder.
ValidateLogicalObjectsToCommit
¶ Validates
NXOpen.PDM.LogicalObject
objects with this builder and udpates the operation failuers.NXOpen.PDM.PartOperationBuilder.GetOperationFailures()
can be called to get the errors occurred during this operation.Signature
ValidateLogicalObjectsToCommit()
New in version NX9.0.0.
License requirements: None.