PartOperationCopyBuilder Class

class NXOpen.PDM.PartOperationCopyBuilder

Bases: NXOpen.PDM.PartOperationBuilder

Represents a builder class that performs various Save As operations.

To create a new instance of this class, use NXOpen.PDM.PdmSession.CreateCopyOperationBuilder()

New in version NX10.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.
DependentFilesToCopyOption Returns or sets the Dependent files Save As option.
ReplaceAllComponents Returns or sets the replace all components.
ReplaceAllComponentsInSession 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.
AddRelatedPartsToCopy 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.
AutoAssignAttributesWithNamingPattern Auto assigns the attributes for a given object and returns an array of objects that failed to auto assign.
ClearWarnings Executes method ClearWarningCodeToLogicalObjectsSetMap() which clears m_warningCodeToLogicalObjectsSetMap
Commit Commits any edits that have been applied to the builder.
CreateAttributeTitleToNamingPatternMap Creates a map object of attribute titles to their corresponding naming pattern
CreateLogicalObjects Creates the pre-creation objects for the parts
CreateNonMasterListForCopyLogicalObject Create NonMaster list for the selected logical Object
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.
EditNonMasterToCopyName 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.
GetCopyNonMasterPartsOption Get the nonmasters saveAs option for given logical object.
GetDialogOperation Returns the dialog operation Applicable only for operation types PartOperationBuilderOperationType.SaveAs and PartOperationBuilderOperationType.Revise
GetErrorMessageHandler Returns ErrorMessageHandler
GetNonMasterCopyOption Get the nonmasters saveAs option for given logical object.
GetNonMasterList Gets NonMaster list for the given logical Object
GetNonMasterListForCopyLogicalObject Gets NonMaster list for the given logical Object
GetObject Returns the object currently being edited by this builder.
GetOperationFailures Returns part operation failures
GetOperationSubType Returns the NXOpen.PDM.PartOperationCopyBuilderOperationSubType for Create.
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.
IsNonMasterForLogicalObjectBeingCopied 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.
SetCopyNonMasterPartsOption Set the nonmasters saveAs option for given logical object.
SetDialogOperation Sets the dialog operation.
SetNonMasterSaveAsOption Set the nonmasters saveAs option for given logical object
SetOperationSubType Sets the NXOpen.PDM.PartOperationCopyBuilderOperationSubType for Create.
SetSelectedNonMasterToCopy Sets whether or not the non-master part specified will actually get saved during the save as operation.
SetSelectedNonMasterToSaveAs Sets whether or not the non-master part specified will actually get saved during the save as operation.
SetSelectedParts Sets the selected parts.
SetSelectedPartsToCopy 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

PartOperationCopyBuilderCopyDependentFiles Enumeration This enum is used to specify which dependent files should be copied to new part during the save as operation.
PartOperationCopyBuilderCopyNonMasterParts Enumeration This enum is used to specify which non-master parts should be copied to new part during the save as operation.
PartOperationCopyBuilderOperationSubType Enumeration Represents an operation sub type for copying a part

Property Detail

DependentFilesToCopyOption

PartOperationCopyBuilder.DependentFilesToCopyOption

Returns or sets the Dependent files Save As option.

Save As option can be one of these PartOperationCopyBuilderCopyDependentFiles.All and PartOperationCopyBuilderCopyDependentFiles.None

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

Getter Method

Signature DependentFilesToCopyOption

Returns:
Return type:NXOpen.PDM.PartOperationCopyBuilderCopyDependentFiles

New in version NX10.0.0.

License requirements: None.

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

Setter Method

Signature DependentFilesToCopyOption

Parameters:saveOption (NXOpen.PDM.PartOperationCopyBuilderCopyDependentFiles) –

New in version NX10.0.0.

License requirements: None.

ReplaceAllComponentsInSession

PartOperationCopyBuilder.ReplaceAllComponentsInSession

Returns or sets the replace all components.

This option specifies whether part will be replaced or copied. Applicable only for operation types PartOperationBuilderOperationType.SaveAs and PartOperationBuilderOperationType.Revise

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

Getter Method

Signature ReplaceAllComponentsInSession

Returns:
Return type:bool

New in version NX10.0.0.

License requirements: None.

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

Setter Method

Signature ReplaceAllComponentsInSession

Parameters:replaceAllComponents (bool) –

New in version NX10.0.0.

License requirements: None.

Method Detail

AddRelatedPartsToCopy

PartOperationCopyBuilder.AddRelatedPartsToCopy

Add related part to the part undergoing an operation.

Example: if user selects a part for Save As which has Linked Part Modules that should also undergo Save As, they should be added as related parts. Applicable only for operation types PartOperationBuilderOperationType.SaveAs and PartOperationBuilderOperationType.Revise

Signature AddRelatedPartsToCopy(basePart, relatedParts, relatedPartsReasons, operation)

Parameters:

New in version NX10.0.0.

License requirements: None.

AutoAssignAttributes

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

AutoAssignAttributesWithNamingPattern

PartOperationCopyBuilder.AutoAssignAttributesWithNamingPattern

Auto assigns the attributes for a given object and returns an array of objects that failed to auto assign.

properties needs to be created using CreateAttributeTitleToNamingPatternMap()

Signature AutoAssignAttributesWithNamingPattern(objects, properties)

Parameters:
Returns:

Return type:

NXOpen.ErrorList

New in version NX12.0.0.

License requirements: None.

CreateAttributeTitleToNamingPatternMap

PartOperationCopyBuilder.CreateAttributeTitleToNamingPatternMap

Creates a map object of attribute titles to their corresponding naming pattern

Signature CreateAttributeTitleToNamingPatternMap(attributeTitles, titlePatterns)

Parameters:
  • attributeTitles (list of str) –
  • titlePatterns (list of str) –
Returns:

Return type:

NXOpen.NXObject

New in version NX12.0.0.

License requirements: None.

CreateNonMasterListForCopyLogicalObject

PartOperationCopyBuilder.CreateNonMasterListForCopyLogicalObject

Create NonMaster list for the selected logical Object

Signature CreateNonMasterListForCopyLogicalObject(logicalObject)

Parameters:logicalObject (NXOpen.PDM.LogicalObject) –

New in version NX10.0.0.

Deprecated since version NX11.0.0: Use NXOpen.PDM.NonMasterData.CreateNonMasterListForLogicalObject() instead

License requirements: None.

EditNonMasterToCopyName

PartOperationCopyBuilder.EditNonMasterToCopyName

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 EditNonMasterToCopyName(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 NX10.0.0.

Deprecated since version NX11.0.0: Use NXOpen.PDM.NonMasterData.EditNonMasterToCopyName() instead

License requirements: None.

GetCopyNonMasterPartsOption

PartOperationCopyBuilder.GetCopyNonMasterPartsOption

Get the nonmasters saveAs option for given logical object.

Save As option can be one of these PartOperationCopyBuilderCopyNonMasterParts.All and PartOperationCopyBuilderCopyNonMasterParts.None

Signature GetCopyNonMasterPartsOption(logicalObject)

Parameters:logicalObject (NXOpen.PDM.LogicalObject) –
Returns:
Return type:NXOpen.PDM.PartOperationCopyBuilderCopyNonMasterParts

New in version NX10.0.0.

Deprecated since version NX11.0.0: Use NXOpen.PDM.NonMasterData.GetCopyNonMasterPartsOption() instead

License requirements: None.

GetNonMasterListForCopyLogicalObject

PartOperationCopyBuilder.GetNonMasterListForCopyLogicalObject

Gets NonMaster list for the given logical Object

Signature GetNonMasterListForCopyLogicalObject(logicalObject)

Parameters:logicalObject (NXOpen.PDM.LogicalObject) –
Returns:Non-master part file names
Return type:list of str

New in version NX10.0.0.

Deprecated since version NX11.0.0: Use NXOpen.PDM.NonMasterData.GetNonMasterListForCopyLogicalObject() instead

License requirements: None.

GetOperationSubType

PartOperationCopyBuilder.GetOperationSubType

Returns the NXOpen.PDM.PartOperationCopyBuilderOperationSubType for Create.

Signature GetOperationSubType()

Returns:
Return type:NXOpen.PDM.PartOperationCopyBuilderOperationSubType

New in version NX10.0.0.

License requirements: None.

IsNonMasterForLogicalObjectBeingCopied

PartOperationCopyBuilder.IsNonMasterForLogicalObjectBeingCopied

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 IsNonMasterForLogicalObjectBeingCopied(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. :rtype: bool

New in version NX10.0.0.

Deprecated since version NX11.0.0: Use NXOpen.PDM.NonMasterData.IsNonMasterForLogicalObjectBeingCopied() instead

License requirements: None.

SetCopyNonMasterPartsOption

PartOperationCopyBuilder.SetCopyNonMasterPartsOption

Set the nonmasters saveAs option for given logical object.

Save As option can be one of these PartOperationCopyBuilderCopyNonMasterParts.All and PartOperationCopyBuilderCopyNonMasterParts.None

Signature SetCopyNonMasterPartsOption(logicalObject, saveOption)

Parameters:

New in version NX10.0.0.

Deprecated since version NX11.0.0: Use NXOpen.PDM.NonMasterData.SetNonMasterSaveAsOption() instead

License requirements: None.

SetOperationSubType

PartOperationCopyBuilder.SetOperationSubType

Sets the NXOpen.PDM.PartOperationCopyBuilderOperationSubType for Create.

Signature SetOperationSubType(operationSubType)

Parameters:operationSubType (NXOpen.PDM.PartOperationCopyBuilderOperationSubType) –

New in version NX10.0.0.

License requirements: None.

SetSelectedNonMasterToCopy

PartOperationCopyBuilder.SetSelectedNonMasterToCopy

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 SetSelectedNonMasterToCopy(logicalObject, partName)

Parameters:
  • logicalObject (NXOpen.PDM.LogicalObject) –
  • partName (str) – the non-master part whose save option is being set here

New in version NX10.0.0.

Deprecated since version NX11.0.0: Use NXOpen.PDM.NonMasterData.SetSelectedNonMasterToCopy() instead

License requirements: None.

SetSelectedPartsToCopy

PartOperationCopyBuilder.SetSelectedPartsToCopy

Sets the selected parts.

Applicable only for operation types PartOperationBuilderOperationType.SaveAs and PartOperationBuilderOperationType.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 SetSelectedPartsToCopy(selectedParts)

Parameters:selectedParts (list of NXOpen.BasePart) –
Returns:
Return type:list of NXOpen.BasePart

New in version NX10.0.0.

License requirements: None.

Validate

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