PartFromPartBuilder Class¶
-
class
NXOpen.PDM.
PartFromPartBuilder
¶ Bases:
NXOpen.PDM.PartBuilder
This class provides the methods necessary to create a new part in NX Manager from an existing part.
This class is **deprecated in NX10</b> for “Save As of master parts” operation. This class should only be used in case of Save As Non Master parts and Save As New Item Type Operations. For Save As of master parts, use
NXOpen.PDM.PartOperationCopyBuilder
. This class will not support Save As if there are duplicate item ids in database.The operation that this builder supports is equivalent to the file save as operation which can:
- Copy a non-master dataset into a previously existing item revision,
- Save a master dataset (and possibly non-master datasets) into a new revision of the same item,
- Save any master or non-master dataset as a completely new item.
The part that is saved is always the work part. If the save is successful, then the newly saved part will be the display part.
This class is a singleton meaning only one instance of it can be exist at a time.
New in version NX4.0.0.
Properties¶
Property | Description |
---|---|
DependentFileSaveAsOption | Returns or sets the dependent files to save during the save as operation |
NonmasterSaveAsOption | Returns or sets the non-master parts to save during the save as operation |
Methods¶
Method | Description |
---|---|
AssignPartFileName | This method generates a part file name given an input part file type and assigns this part file name to the builder. |
AssignPartNumber | This method generates a part number given an input part type and assigns this part number to the builder. |
AssignPartRevision | This method generates a part revision and assigns this part revision to the builder. |
Commit | Creates the new part that has been fully-specified by calling methods on this builder. |
CreateNonmasterList | Initializes the list of non-master parts that can be saved during the save as operation. |
CreatePartCreationObject | Create an instance of a NXOpen.PDM.PartCreationObject class that acts as a proxy for a part in NX Manager mode prior to that part being created. |
CreatePartSpec | Create the specification for the new part that will be created. |
Dispose | Free resources associated with the instance. |
EditNonmasterNameToSaveAs | Sets the name the non-master part will get saved as. |
GetNonmasterList | Gets the list of non-master parts. |
GetNonmasterToSaveAs | Returns whether or not the non-master part specified will actually get saved during the save as operation. |
NewAlternateIdManager | Create an instance of a NXOpen.PDM.AlternateIdManager class that will be used to create alternate ID information while creating the new part. |
NewDatabaseAttributeManager | Create an instance of a NXOpen.PDM.DatabaseAttributeManager class that will be used to modify database attributes while creating the new part. |
SetAssignPartNumber | Sets the part number explicitly into builder. |
SetAssignPartType | Sets the part type explicitly into builder. |
SetContextOperation | Sets explicitly the place from where part selection dialog invoked into builder. |
SetNonmasterToSaveAs | Sets whether or not the non-master part specified will actually get saved during the save as operation. |
Enumerations¶
PartFromPartBuilderFileSaveAs Enumeration | This enum is used to specify which non-master parts and dependent files should be saved during the save as operation. |
Property Detail¶
DependentFileSaveAsOption¶
-
PartFromPartBuilder.
DependentFileSaveAsOption
¶ Returns or sets the dependent files to save during the save as operation
Deprecated in NX10 for “Save As of master parts” operation. This should only be used in case of Save As New Item Type Operations. For Save As of master parts, use
NXOpen.PDM.PartOperationCopyBuilder.DependentFilesToCopyOption()
.-------------------------------------
Getter Method
Signature
DependentFileSaveAsOption()
Returns: Return type: NXOpen.PDM.PartFromPartBuilderFileSaveAs
New in version NX4.0.0.
License requirements: None.
-------------------------------------
Setter Method
Signature
DependentFileSaveAsOption(saveOption)
Parameters: saveOption ( NXOpen.PDM.PartFromPartBuilderFileSaveAs
) –New in version NX4.0.0.
License requirements: None.
NonmasterSaveAsOption¶
-
PartFromPartBuilder.
NonmasterSaveAsOption
¶ Returns or sets the non-master parts to save during the save as operation
Deprecated in NX10 for “Save As of master parts” operation. This should only be used in case of Save As New Item Type Operations. For Save As of master parts, use
NXOpen.PDM.PartOperationCopyBuilder.GetCopyNonMasterPartsOption()
.-------------------------------------
Getter Method
Signature
NonmasterSaveAsOption()
Returns: Return type: NXOpen.PDM.PartFromPartBuilderFileSaveAs
New in version NX4.0.0.
License requirements: None.
-------------------------------------
Setter Method
Signature
NonmasterSaveAsOption(saveOption)
Parameters: saveOption ( NXOpen.PDM.PartFromPartBuilderFileSaveAs
) –New in version NX4.0.0.
License requirements: None.
Method Detail¶
Commit¶
-
PartFromPartBuilder.
Commit
¶ Creates the new part that has been fully-specified by calling methods on this builder.
Deprecated in NX10 for “Save As of master parts” operation. This should only be used in case of Save As Non Master parts and Save As New Item Type Operations. For Save As of master parts, use
Builder.Commit()
instead.Signature
Commit()
New in version NX4.0.0.
License requirements: None.
CreateNonmasterList¶
-
PartFromPartBuilder.
CreateNonmasterList
¶ Initializes the list of non-master parts that can be saved during the save as operation.
Deprecated in NX10 for “Save As of master parts” operation. This should only be used in case of Save As New Item Type Operations. For Save As of master parts, use
NXOpen.PDM.PartOperationCopyBuilder.CreateNonMasterListForCopyLogicalObject()
.Signature
CreateNonmasterList()
New in version NX4.0.0.
License requirements: None.
Dispose¶
-
PartFromPartBuilder.
Dispose
¶ Free resources associated with the instance.
After this method is called, it is illegal to use the object. In .NET, this method is automatically called when the object is deleted by the garbage collector.
Signature
Dispose()
New in version NX4.0.0.
License requirements: None.
EditNonmasterNameToSaveAs¶
-
PartFromPartBuilder.
EditNonmasterNameToSaveAs
¶ 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.
Deprecated in NX10 for “Save As of master parts” operation. This should only be used in case of Save As New Item Type Operations. For Save As of master parts, use
NXOpen.PDM.PartOperationCopyBuilder.EditNonMasterToCopyName()
.Signature
EditNonmasterNameToSaveAs(oldName, newName)
Parameters: - oldName (str) – the non-master part whose save as name is being set here
- newName (str) – the new name
Returns: Whether or not the name is a valid data set
name. The name will get set on the builder no matter if it is valid or not. :rtype: bool
New in version NX4.0.0.
License requirements: None.
GetNonmasterList¶
-
PartFromPartBuilder.
GetNonmasterList
¶ Gets the list of non-master parts.
Deprecated in NX10 for “Save As of master parts” operation. This should only be used in case of Save As New Item Type Operations. For Save As of master parts, use
NXOpen.PDM.PartOperationCopyBuilder.GetNonMasterListForCopyLogicalObject()
.Signature
GetNonmasterList()
Returns: Non-master part file names Return type: list of str New in version NX8.5.0.
License requirements: None.
GetNonmasterToSaveAs¶
-
PartFromPartBuilder.
GetNonmasterToSaveAs
¶ Returns whether or not the non-master part specified will actually get saved during the save as operation.
Deprecated in NX10 for “Save As of master parts” operation. This should only be used in case of Save As New Item Type Operations. For Save As of master parts, use
NXOpen.PDM.PartOperationCopyBuilder.IsNonMasterForLogicalObjectBeingCopied()
.Signature
GetNonmasterToSaveAs(partName)
Parameters: 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 NX4.0.0.
License requirements: None.
SetNonmasterToSaveAs¶
-
PartFromPartBuilder.
SetNonmasterToSaveAs
¶ 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.
Deprecated in NX10 for “Save As of master parts” operation. This should only be used in case of Save As New Item Type Operations. For Save As of master parts, use
NXOpen.PDM.PartOperationCopyBuilder.SetSelectedNonMasterToCopy()
.Signature
SetNonmasterToSaveAs(partName, doSaveAs)
Parameters: - partName (str) – the non-master part whose save option is being set here
- doSaveAs (bool) – True means that this non-master part will be saved. False means that this non-master part will not be saved.
New in version NX4.0.0.
License requirements: None.