PartBuilder Class¶
-
class
NXOpen.PDM.
PartBuilder
¶ Bases:
NXOpen.TransientObject
This class serves as the base class for NX Manager part builders.
The NX Manager part builders are used to create new parts in NX Manager mode.
This class is **deprecated in NX10</b> for “Create” and “Save As of master parts” operations. This class should only be used in case of Save As Non Master parts and Save As New Item Type Operations. For Create of all parts use
NXOpen.PDM.PartOperationBuilder
andNXOpen.FileNew
For Save As of master parts, useNXOpen.PDM.PartOperationCopyBuilder
.This is an abstract class, and cannot be created.
New in version NX4.0.0.
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. |
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. |
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. |
Enumerations¶
PartBuilderOperation Enumeration | Tokens identifying every possible UG/Manager part selection dialog. |
Structs¶
PartBuilderPartFileNameData_Struct Struct | Contains part file name information |
PartBuilderPartNumberData_Struct Struct | Contains part number information. |
PartBuilderPartRevisionData_Struct Struct | Contains part revision information |
Method Detail¶
AssignPartFileName¶
-
PartBuilder.
AssignPartFileName
¶ Overloaded method AssignPartFileName
AssignPartFileName(partFileType)
AssignPartFileName(partNumber, partRevision, partFileNameType, oldPartFileName)
-------------------------------------
This method generates a part file name given an input part file type and assigns this part file name to the builder.
This method depends on the part type, part number, and part revision already being set on the builder. Therefore, a call to
PDM.PartBuilder.CreatePartSpec()
or, more likely, calls toPDM.PartBuilder.AssignPartNumber()
andPDM.PartBuilder.AssignPartRevision()
must be made before calling this method.If this method is called before
PDM.PartBuilder.CreatePartSpec()
(as will typically be the case) then the **part_file_type</b> and **part_file_name</b> parameters ofPDM.PartBuilder.CreatePartSpec()
should be set to None so that the builder will use the values assigned by this method. Otherwise, CreatePartSpec will override the values assigned here and assign the values of the **part_file_type</b> and **part_file_name</b> parameters to the builder.Deprecated in NX10 except for Save As Non Master part and Save As to New Item Type operations. Use
NXOpen.PDM.PartOperationBuilder.CreateSpecificationsForLogicalObjects()
instead.Signature
AssignPartFileName(partFileType)
Parameters: partFileType (str) – the part file type. Note that if the part file type is “master”, then this method will return None but will still set the part file type in the builder. Returns: the assigned part file name Return type: str New in version NX4.0.0.
License requirements: None.
-------------------------------------
This method generates a part file name and assigns this part file name to the builder.
If this method is called before
PDM.PartBuilder.CreatePartSpec()
then the **part_file_name</b> parameter ofPDM.PartBuilder.CreatePartSpec()
should be set to None so that the builder will use the value assigned by this method. Otherwise, CreatePartSpec will override the value assigned here and assign the values of the **part_file_type</b> and **part_file_name</b> parameters to the builder.Deprecated in NX10 except for Save As Non Master part and Save As to New Item Type operations. Use
NXOpen.PDM.PartOperationBuilder.CreateSpecificationsForLogicalObjects()
instead.Signature
AssignPartFileName(partNumber, partRevision, partFileNameType, oldPartFileName)
Parameters: - partNumber (str) – Part Number
- partRevision (str) – part revision
- partFileNameType (str) – Part file name type. Note that if the part file type is “master”, then this method will set the field **PartFileName</b> of
PDM.PartBuilderPartFileNameData_Struct
with None - oldPartFileName (str) – Old part file name
Returns: Return type: New in version NX5.0.0.
License requirements: None.
-------------------------------------
AssignPartNumber¶
-
PartBuilder.
AssignPartNumber
¶ Overloaded method AssignPartNumber
AssignPartNumber(partType)
AssignPartNumber(oldPartNumber, partType)
-------------------------------------
This method generates a part number given an input part type and assigns this part number to the builder.
The input part type will also be assigned to the builder. If the input part type is None then this method will fail unless the part type has already been set on the builder via a previous call to this method or to
PDM.PartBuilder.CreatePartSpec()
.If this method is called before
PDM.PartBuilder.CreatePartSpec()
(as will typically be the case) then the **part_type</b> and **part_number</b> parameters ofPDM.PartBuilder.CreatePartSpec()
should be set to None so that the builder will use the values assigned by this method. Otherwise, CreatePartSpec will override the values assigned here and assign the values of the **part_type</b> and **part_number</b> parameters to the builder.The output part_number: In case of Default Domain: it is Teamcenter item ID. In case of non-Default Domain: it is the multifield key. e.g. %#MFK#%,=item_id=001, object_type=SupplierPart, supplier_code=x
Deprecated in NX10 except for Save As Non Master part and Save As to New Item Type operations. Use
NXOpen.PDM.PartOperationCreateBuilder
for Create andNXOpen.PDM.PartOperationCopyBuilder
for Save As instead. To assign part number, useNXOpen.PDM.LogicalObject
andNXOpen.AttributePropertiesBuilder
to create DB_PART_NO attribute.Signature
AssignPartNumber(partType)
Parameters: partType (str) – the part type Returns: the assigned multifield key Return type: str New in version NX4.0.0.
License requirements: None.
-------------------------------------
This method generates a part number given an input part type and sets this part number to the builder.
The input part type will also be assigned to the builder. If the input part type is None then this method will fail unless the part type has already been set on the builder via a previous call to this method or to
PDM.PartBuilder.CreatePartSpec()
.If this overloaded method is called before
PDM.PartBuilder.CreatePartSpec()
then the **part_number</b> parameter ofPDM.PartBuilder.CreatePartSpec()
should be set to None so that the builder will use the value assigned by this method. Otherwise, CreatePartSpec will override the value assigned here and assign the value of **part_number</b> parameter to the builder.The output part_number in part_info structure: In case of Default Domain: it is Teamcenter item ID. In case of non-Default Domain: it is the multifield key. e.g. %#MFK#%,=item_id=001, object_type=SupplierPart, supplier_code=x
Deprecated in NX10 except for Save As Non Master part and Save As to New Item Type operations. Use
NXOpen.PDM.PartOperationCreateBuilder
for Create andNXOpen.PDM.PartOperationCopyBuilder
for Save As instead. To assign part number, useNXOpen.PDM.LogicalObject
andNXOpen.AttributePropertiesBuilder
to create DB_PART_NO attribute.Signature
AssignPartNumber(oldPartNumber, partType)
Parameters: - oldPartNumber (str) – Old part number
- partType (str) – Part type
Returns: Contains part number information.
Return type: New in version NX5.0.0.
License requirements: None.
-------------------------------------
AssignPartRevision¶
-
PartBuilder.
AssignPartRevision
¶ Overloaded method AssignPartRevision
AssignPartRevision()
AssignPartRevision(overload)
-------------------------------------
This method generates a part revision and assigns this part revision to the builder.
This method depends on the part type and part number already being set on the builder. Therefore, a call to
PDM.PartBuilder.CreatePartSpec()
or, more likely, toAssignPartNumber()
must be made before calling this method.If this method is called before
PDM.PartBuilder.CreatePartSpec()
(as will typically be the case) then the **part_revision</b> parameter ofPDM.PartBuilder.CreatePartSpec()
should be set to None so that the builder will use the value assigned by this method. Otherwise, CreatePartSpec will override the value assigned here and assign the value of the **part_revision</b> parameters to the builder.Deprecated in NX10 except for Save As Non Master part and Save As to New Item Type operations. Use
NXOpen.PDM.PartOperationCreateBuilder
for Create andNXOpen.PDM.PartOperationCopyBuilder
for Save As instead. To assign part number, useNXOpen.PDM.LogicalObject
andNXOpen.AttributePropertiesBuilder
to create DB_PART_REV attribute.Signature
AssignPartRevision()
Returns: the assigned part revision Return type: str New in version NX4.0.0.
License requirements: None.
-------------------------------------
This method generates a part revision and sets this part revision to the builder.
This method depends on the part type and part number already being set on the builder. Therefore, a call to
PDM.PartBuilder.CreatePartSpec()
or, more likely, toAssignPartNumber()
must be made before calling this method.If this method is called before
PDM.PartBuilder.CreatePartSpec()
then the **part_revision</b> parameter ofPDM.PartBuilder.CreatePartSpec()
should be set to None so that the builder will use the value assigned by this method. Otherwise, CreatePartSpec will override the value assigned here and assign the value of the **part_revision</b> parameters to the builder.Deprecated in NX10 except for Save As Non Master part and Save As to New Item Type operations. Use
NXOpen.PDM.PartOperationCreateBuilder
for Create andNXOpen.PDM.PartOperationCopyBuilder
for Save As instead. To assign part number, useNXOpen.PDM.LogicalObject
andNXOpen.AttributePropertiesBuilder
to create DB_PART_REV attribute.Signature
AssignPartRevision(overload)
Parameters: overload (int) – Dummy parameter to call this overloaded method Returns: Contains part revision information Return type: NXOpen.PDM.PartBuilderPartRevisionData_Struct
New in version NX5.0.0.
License requirements: None.
-------------------------------------
CreatePartCreationObject¶
-
PartBuilder.
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.Signature
CreatePartCreationObject()
Returns: the new NXOpen.PDM.PartCreationObject
instanceReturn type: NXOpen.PDM.PartCreationObject
New in version NX8.0.0.
License requirements: None.
CreatePartSpec¶
-
PartBuilder.
CreatePartSpec
¶ Create the specification for the new part that will be created.
For the input part_number: In case of Default Domain: it is Teamcenter item ID. In case of non-Default Domain: it is the multifield key. e.g. %#MFK#%,=item_id=001, object_type=SupplierPart, supplier_code=x And the encoded part filename would be containing the MFK.
NOTE: The part_file_name argument is the Dataset Name and is applicable only while creating specs for non-master parts.
Deprecated in NX10 except for Save As Non Master part and Save As to New Item Type operations. Use
NXOpen.PDM.PartOperationBuilder.CreateSpecificationsForLogicalObjects()
instead.Signature
CreatePartSpec(partType, partNumber, partRevision, partFileType, partFileName)
Parameters: - partType (str) – the part type
- partNumber (str) – the multifield key
- partRevision (str) – the part revision
- partFileType (str) – the part file type
- partFileName (str) – the dataset name
New in version NX4.0.0.
License requirements: None.
Dispose¶
-
PartBuilder.
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.
NewAlternateIdManager¶
-
PartBuilder.
NewAlternateIdManager
¶ Create an instance of a
NXOpen.PDM.AlternateIdManager
class that will be used to create alternate ID information while creating the new part.Signature
NewAlternateIdManager()
Returns: the new NXOpen.PDM.AlternateIdManager
instanceReturn type: NXOpen.PDM.AlternateIdManager
New in version NX4.0.0.
License requirements: None.
NewDatabaseAttributeManager¶
-
PartBuilder.
NewDatabaseAttributeManager
¶ Create an instance of a
NXOpen.PDM.DatabaseAttributeManager
class that will be used to modify database attributes while creating the new part.Signature
NewDatabaseAttributeManager()
Returns: the new NXOpen.PDM.DatabaseAttributeManager
instanceReturn type: NXOpen.PDM.DatabaseAttributeManager
New in version NX4.0.0.
License requirements: None.
SetAssignPartNumber¶
-
PartBuilder.
SetAssignPartNumber
¶ Sets the part number explicitly into builder.
This method is called before
PDM.PartBuilder.CreatePartSpec()
Deprecated in NX10 except for Save As Non Master part and Save As to New Item Type operations. Use
NXOpen.PDM.PartOperationCreateBuilder
for Create andNXOpen.PDM.PartOperationCopyBuilder
for Save As instead. To assign part number, useNXOpen.PDM.LogicalObject
andNXOpen.AttributePropertiesBuilder
to set the DB_PART_NO attribute.Signature
SetAssignPartNumber(partNumber)
Parameters: partNumber (str) – the part number New in version NX5.0.0.
License requirements: None.
SetAssignPartType¶
-
PartBuilder.
SetAssignPartType
¶ Sets the part type explicitly into builder.
This method is called before
PDM.PartBuilder.CreatePartSpec()
Deprecated in NX10 except for Save As Non Master part and Save As to New Item Type operations. Use
NXOpen.PDM.PartOperationBuilder.CreateSpecificationsForLogicalObjects()
instead.Signature
SetAssignPartType(partType)
Parameters: partType (str) – New in version NX5.0.0.
License requirements: None.
SetContextOperation¶
-
PartBuilder.
SetContextOperation
¶ Sets explicitly the place from where part selection dialog invoked into builder.
Deprecated in NX10 except for Save As Non Master part and Save As to New Item Type operations. Use
NXOpen.PDM.PartOperationBuilder.CreateSpecificationsForLogicalObjects()
instead.Signature
SetContextOperation(operation)
Parameters: operation ( NXOpen.PDM.PartBuilderOperation
) – Token identifying place from where UG/Manager part selection dialog invokedNew in version NX5.0.0.
License requirements: None.