TemplateManager Class¶
-
class
NXOpen.PartFamily.
TemplateManager
¶ Bases:
NXOpen.TransientObject
This class serves as the manager for all the part family related operations.
All operations that create, edit or delete part family objects are done through this class. Use the method
Part.NewPartFamilyTemplateManager
to create new instance of this class.New in version NX9.0.0.
Properties¶
Property | Description |
---|---|
Importable | Returns or sets the importable flag value |
SaveDirectory | Returns or sets the save directory path value |
Methods¶
Method | Description |
---|---|
AddAssertedMassToChosenAttributes | Adds new attribute of type asserted mass to chosen attributes list of a part family |
AddInstanceDefinition | Creates a new family member definition with the supplied name and places it just under previous family member definition. |
AddInstanceDefinitionUsingMemberIdentifier | Creates a new family member definition with the supplied member identifier places it just under previous family member definition. |
AddOptionalCreationNonKeyAttrsToChosenAttrs | Add all optional creation non key attributes to chosen list at the end or after a selected attribute from chosen attribute list. |
AddToChosenAttributes | Adds new attributes to chosen attributes list of a part family |
CreateMemberIdentifier | Creates a member identifier for a part family member from the key attributes and value pair. |
CreatePartFamily | Creates a part family associated with the owning part @return |
CutAttributes | Cut selected attributes of a part family. |
DeleteInstanceDefinition | Delete the family member definition from template manager |
DeletePartFamily | Deletes a part family associated with the manager/owning part |
DeletePartFamilyAttribute | Deletes a given part family attribute |
Dispose | Free resources associated with the instance. |
EditPartFamily | Edits a part family associated with the manager/owning part |
EstablishFamilyInstance | Creates a part family member if it doesn’t exist on disk. |
GetAllKeyAttrs | Obtains all key attributes (required and optional) required to construct the MFK ID. |
GetChosenAttributes | Returns the attributes on the template manager These might include the attributes which have not yet been committed onto the core object and have only been created by this instance of the manager. |
GetInfoMessages | Obtains the list of messages that may have been encountered in any workflow. |
GetInstanceDefinition | Get the family member definition already present in family @return |
GetInstanceDefinitionUsingMemberIdentifier | Obtains the family member definition already present in family A non zero return code implies familyMemberDefinition is NULL @return |
GetPartFamilyAttribute | Get the part family attribute from part family template @return |
GetPartFamilyTemplate | Get the part family template This method may return NULL if there is no template associated with the templatemanager @return |
GetSelectableAttributes | The list of attribute names of a given type in the owning part These can be used to create part family attributes @return |
MoveDownAttributes | Move down the specified attributes of a part family by the moveDownCount. |
MoveUpAttributes | Move up the specified attributes of a part family by the moveUpCount. |
PasteAttributes | Paste the cut attributes of a part family. |
RefreshDefaultAttrs | Repopulates required attributes in chosen list so that it updates as per the teamcenter customizations, if it has changed since last saved template. |
ReorderInstanceDefinition | Reorder (relocate) familyMemberDefinition just after the previousFamilyMemberDefn |
SaveFamilyAndApplyValues | Save part family and apply the values of chosen family member definition to the template part, It returns failure codes through errorCode. |
SaveFamilyAndCreateMembers | Save part family and create the family members supplied through input array. |
SaveFamilyAndUpdateMembers | Save part family and update the family members supplied through input array. |
SavePartFamily | Save the changes in template manager to core part family |
Property Detail¶
Importable¶
-
TemplateManager.
Importable
¶ Returns or sets the importable flag value
-------------------------------------
Getter Method
Signature
Importable()
Returns: Return type: bool New in version NX9.0.0.
License requirements: solid_modeling (“SOLIDS MODELING”)
-------------------------------------
Setter Method
Signature
Importable(isImportable)
Parameters: isImportable (bool) – New in version NX9.0.0.
License requirements: solid_modeling (“SOLIDS MODELING”)
SaveDirectory¶
-
TemplateManager.
SaveDirectory
¶ Returns or sets the save directory path value
-------------------------------------
Getter Method
Signature
SaveDirectory()
Returns: Return type: str New in version NX9.0.0.
License requirements: solid_modeling (“SOLIDS MODELING”)
-------------------------------------
Setter Method
Signature
SaveDirectory(saveDirectory)
Parameters: saveDirectory (str) – New in version NX9.0.0.
License requirements: solid_modeling (“SOLIDS MODELING”)
Method Detail¶
AddAssertedMassToChosenAttributes¶
-
TemplateManager.
AddAssertedMassToChosenAttributes
¶ Adds new attribute of type asserted mass to chosen attributes list of a part family
Signature
AddAssertedMassToChosenAttributes(attrToAdd, indexAddAt)
Parameters: - attrToAdd (str) –
- indexAddAt (int) –
New in version NX9.0.0.
License requirements: adv_assemblies (“ADVANCED ASSEMBLIES”), solid_modeling (“SOLIDS MODELING”)
AddInstanceDefinition¶
-
TemplateManager.
AddInstanceDefinition
¶ Creates a new family member definition with the supplied name and places it just under previous family member definition.
If the part family is importable, then the otherNameEntry is a mandatory input. Depending on whether we are in managed mode or native, familyMemberDefn name may be os_part_name or db_part_name, and otherNameEntry may be db_part_name or os_part_name. In case of non-importable part family otherName Entry may be empty.
Signature
AddInstanceDefinition(familyMemberDefnName, previousFamilyMemberDefn, otherNameEntry)
Parameters: - familyMemberDefnName (str) –
- previousFamilyMemberDefn (
NXOpen.PartFamily.InstanceDefinition
) – - otherNameEntry (str) –
Returns: Return type: New in version NX9.0.0.
License requirements: solid_modeling (“SOLIDS MODELING”)
AddInstanceDefinitionUsingMemberIdentifier¶
-
TemplateManager.
AddInstanceDefinitionUsingMemberIdentifier
¶ Creates a new family member definition with the supplied member identifier places it just under previous family member definition.
If the part family is importable, then the otherNameEntry is a mandatory input. Depending on whether we are in managed mode or native, otherNameEntry may be db_part_name or os_part_name. In case of non-importable part family otherNameEntry may be empty.
Signature
AddInstanceDefinitionUsingMemberIdentifier(familyMemberIdentifier, previousFamilyMemberDefn, otherNameEntry)
Parameters: - familyMemberIdentifier (
NXOpen.PartFamily.MemberIdentifier
) – - previousFamilyMemberDefn (
NXOpen.PartFamily.InstanceDefinition
) – - otherNameEntry (str) –
Returns: Return type: New in version NX10.0.0.
License requirements: solid_modeling (“SOLIDS MODELING”)
- familyMemberIdentifier (
AddOptionalCreationNonKeyAttrsToChosenAttrs¶
-
TemplateManager.
AddOptionalCreationNonKeyAttrsToChosenAttrs
¶ Add all optional creation non key attributes to chosen list at the end or after a selected attribute from chosen attribute list.
To add all optional creation attributes at the end, pass pasteAfter as NULL. If an optional attribute is already present in chosen attribute list, it does not add it again. Outputs an array of the optional attributes that were actually added to chosen list
Signature
AddOptionalCreationNonKeyAttrsToChosenAttrs(pasteAfter)
Parameters: pasteAfter ( NXOpen.PartFamily.FamilyAttribute
) –Returns: Return type: list of NXOpen.PartFamily.FamilyAttribute
New in version NX10.0.0.
License requirements: solid_modeling (“SOLIDS MODELING”)
AddToChosenAttributes¶
-
TemplateManager.
AddToChosenAttributes
¶ Adds new attributes to chosen attributes list of a part family
Signature
AddToChosenAttributes(attrsToAdd, attrsTypes, indexAddAt)
Parameters: - attrsToAdd (list of str) –
- attrsTypes (list of
NXOpen.PartFamily.FamilyAttributeAttrType
) – - indexAddAt (int) –
New in version NX9.0.0.
License requirements: solid_modeling (“SOLIDS MODELING”)
CreateMemberIdentifier¶
-
TemplateManager.
CreateMemberIdentifier
¶ Creates a member identifier for a part family member from the key attributes and value pair.
In native mode the itemType is NULL In managed mode, the value of itemType could be NULL in which case Template’s item type will be used while creating the MemberIdentifier
Signature
CreateMemberIdentifier(keyAttrs, attrValues, itemType)
Parameters: - keyAttrs (list of
NXOpen.PartFamily.FamilyAttribute
) – - attrValues (list of str) –
- itemType (str) –
Returns: Return type: New in version NX10.0.0.
License requirements: solid_modeling (“SOLIDS MODELING”)
- keyAttrs (list of
CreatePartFamily¶
-
TemplateManager.
CreatePartFamily
¶ Creates a part family associated with the owning part
Signature
CreatePartFamily()
Returns: Return type: NXOpen.PartFamily.Template
New in version NX9.0.0.
License requirements: solid_modeling (“SOLIDS MODELING”)
CutAttributes¶
-
TemplateManager.
CutAttributes
¶ Cut selected attributes of a part family.
These will be pasted during paste operation. If previously cut attributes are present then they will be lost because the new ones will overwrite them.
Signature
CutAttributes(cutAttrs)
Parameters: cutAttrs (list of NXOpen.PartFamily.FamilyAttribute
) –New in version NX9.0.0.
License requirements: solid_modeling (“SOLIDS MODELING”)
DeleteInstanceDefinition¶
-
TemplateManager.
DeleteInstanceDefinition
¶ Delete the family member definition from template manager
Signature
DeleteInstanceDefinition(familyMemberDefinition)
Parameters: familyMemberDefinition ( NXOpen.PartFamily.InstanceDefinition
) –New in version NX9.0.0.
License requirements: solid_modeling (“SOLIDS MODELING”)
DeletePartFamily¶
-
TemplateManager.
DeletePartFamily
¶ Deletes a part family associated with the manager/owning part
Signature
DeletePartFamily()
New in version NX9.0.0.
License requirements: solid_modeling (“SOLIDS MODELING”)
DeletePartFamilyAttribute¶
-
TemplateManager.
DeletePartFamilyAttribute
¶ Deletes a given part family attribute
Signature
DeletePartFamilyAttribute(partFamilyAttribute)
Parameters: partFamilyAttribute ( NXOpen.PartFamily.FamilyAttribute
) –New in version NX9.0.0.
License requirements: solid_modeling (“SOLIDS MODELING”)
Dispose¶
-
TemplateManager.
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 NX9.0.0.
License requirements: None.
EditPartFamily¶
-
TemplateManager.
EditPartFamily
¶ Edits a part family associated with the manager/owning part
Signature
EditPartFamily()
New in version NX9.0.0.
License requirements: solid_modeling (“SOLIDS MODELING”)
EstablishFamilyInstance¶
-
TemplateManager.
EstablishFamilyInstance
¶ Creates a part family member if it doesn’t exist on disk.
Signature
EstablishFamilyInstance(memberName)
Parameters: memberName (str) – Returns: Return type: str New in version NX9.0.0.
License requirements: solid_modeling (“SOLIDS MODELING”)
GetAllKeyAttrs¶
-
TemplateManager.
GetAllKeyAttrs
¶ Obtains all key attributes (required and optional) required to construct the MFK ID.
These would be used to create the unique member identifier.
Signature
GetAllKeyAttrs()
Returns: Return type: list of NXOpen.PartFamily.FamilyAttribute
New in version NX10.0.0.
License requirements: solid_modeling (“SOLIDS MODELING”)
GetChosenAttributes¶
-
TemplateManager.
GetChosenAttributes
¶ Returns the attributes on the template manager These might include the attributes which have not yet been committed onto the core object and have only been created by this instance of the manager.
“Use
Template.GetAttributes
to get the committed attributes”Signature
GetChosenAttributes()
Returns: Return type: list of NXOpen.PartFamily.FamilyAttribute
New in version NX9.0.0.
License requirements: solid_modeling (“SOLIDS MODELING”)
GetInfoMessages¶
-
TemplateManager.
GetInfoMessages
¶ Obtains the list of messages that may have been encountered in any workflow.
This is a generic routine to get all information (Error/Warning/Info) that are deemed useful to user. Contains error messages encountered during save like material issues, interpart expression issues, invalid member names. In addition, if there were locked attributes (i.e. attributes whose value cannot be updated), this also would contain the names of such attributes.
Signature
GetInfoMessages()
Returns: Return type: list of str New in version NX10.0.0.
License requirements: solid_modeling (“SOLIDS MODELING”)
GetInstanceDefinition¶
-
TemplateManager.
GetInstanceDefinition
¶ Get the family member definition already present in family
Signature
GetInstanceDefinition(familyMemberDefnName)
Parameters: familyMemberDefnName (str) – Returns: Return type: NXOpen.PartFamily.InstanceDefinition
New in version NX9.0.0.
License requirements: solid_modeling (“SOLIDS MODELING”)
GetInstanceDefinitionUsingMemberIdentifier¶
-
TemplateManager.
GetInstanceDefinitionUsingMemberIdentifier
¶ Obtains the family member definition already present in family A non zero return code implies familyMemberDefinition is NULL
Signature
GetInstanceDefinitionUsingMemberIdentifier(familyMemberIdentifier)
Parameters: familyMemberIdentifier ( NXOpen.PartFamily.MemberIdentifier
) –Returns: Return type: NXOpen.PartFamily.InstanceDefinition
New in version NX10.0.0.
License requirements: solid_modeling (“SOLIDS MODELING”)
GetPartFamilyAttribute¶
-
TemplateManager.
GetPartFamilyAttribute
¶ Get the part family attribute from part family template
Signature
GetPartFamilyAttribute(attrType, attrName)
Parameters: - attrType (
NXOpen.PartFamily.FamilyAttributeAttrType
) – - attrName (str) –
Returns: Return type: New in version NX9.0.0.
License requirements: solid_modeling (“SOLIDS MODELING”)
- attrType (
GetPartFamilyTemplate¶
-
TemplateManager.
GetPartFamilyTemplate
¶ Get the part family template This method may return NULL if there is no template associated with the templatemanager
Signature
GetPartFamilyTemplate()
Returns: Return type: NXOpen.PartFamily.Template
New in version NX9.0.0.
License requirements: solid_modeling (“SOLIDS MODELING”)
GetSelectableAttributes¶
-
TemplateManager.
GetSelectableAttributes
¶ The list of attribute names of a given type in the owning part These can be used to create part family attributes
Signature
GetSelectableAttributes(attrType)
Parameters: attrType ( NXOpen.PartFamily.FamilyAttributeAttrType
) –Returns: Return type: list of str New in version NX9.0.0.
License requirements: solid_modeling (“SOLIDS MODELING”)
MoveDownAttributes¶
-
TemplateManager.
MoveDownAttributes
¶ Move down the specified attributes of a part family by the moveDownCount.
If the attributes cannot be moved down by the specified count, this method will execute the partial move and return the count that the attributes are actually moved down by.
Signature
MoveDownAttributes(moveDownAttrs, moveDownCount)
Parameters: - moveDownAttrs (list of
NXOpen.PartFamily.FamilyAttribute
) – - moveDownCount (int) –
Returns: Return type: int
New in version NX9.0.0.
License requirements: solid_modeling (“SOLIDS MODELING”)
- moveDownAttrs (list of
MoveUpAttributes¶
-
TemplateManager.
MoveUpAttributes
¶ Move up the specified attributes of a part family by the moveUpCount.
If the attributes cannot be moved up by the specified count, this method will execute the partial move and return the count that the attributes are actually moved up by.
Signature
MoveUpAttributes(moveUpAttrs, moveUpCount)
Parameters: - moveUpAttrs (list of
NXOpen.PartFamily.FamilyAttribute
) – - moveUpCount (int) –
Returns: Return type: int
New in version NX9.0.0.
License requirements: solid_modeling (“SOLIDS MODELING”)
- moveUpAttrs (list of
PasteAttributes¶
-
TemplateManager.
PasteAttributes
¶ Paste the cut attributes of a part family.
The pasteAfter attribute must be present in chosen attributes list for this operation to succeed.
Signature
PasteAttributes(pasteAfter)
Parameters: pasteAfter ( NXOpen.PartFamily.FamilyAttribute
) –New in version NX9.0.0.
License requirements: solid_modeling (“SOLIDS MODELING”)
RefreshDefaultAttrs¶
-
TemplateManager.
RefreshDefaultAttrs
¶ Repopulates required attributes in chosen list so that it updates as per the teamcenter customizations, if it has changed since last saved template.
Signature
RefreshDefaultAttrs()
New in version NX10.0.0.
License requirements: solid_modeling (“SOLIDS MODELING”)
ReorderInstanceDefinition¶
-
TemplateManager.
ReorderInstanceDefinition
¶ Reorder (relocate) familyMemberDefinition just after the previousFamilyMemberDefn
Signature
ReorderInstanceDefinition(familyMemberDefinition, previousFamilyMemberDefn)
Parameters: - familyMemberDefinition (
NXOpen.PartFamily.InstanceDefinition
) – - previousFamilyMemberDefn (
NXOpen.PartFamily.InstanceDefinition
) –
New in version NX9.0.0.
License requirements: solid_modeling (“SOLIDS MODELING”)
- familyMemberDefinition (
SaveFamilyAndApplyValues¶
-
TemplateManager.
SaveFamilyAndApplyValues
¶ Save part family and apply the values of chosen family member definition to the template part, It returns failure codes through errorCode.
Signature
SaveFamilyAndApplyValues(familyMemberDefinition)
Parameters: familyMemberDefinition ( NXOpen.PartFamily.InstanceDefinition
) –Returns: Return type: int New in version NX9.0.0.
License requirements: solid_modeling (“SOLIDS MODELING”)
SaveFamilyAndCreateMembers¶
-
TemplateManager.
SaveFamilyAndCreateMembers
¶ Save part family and create the family members supplied through input array.
It returns success and failure codes via errorCodes array.
Signature
SaveFamilyAndCreateMembers(instDefsToCreate)
Parameters: instDefsToCreate (list of NXOpen.PartFamily.InstanceDefinition
) –Returns: Return type: list of int New in version NX9.0.0.
License requirements: solid_modeling (“SOLIDS MODELING”)
SaveFamilyAndUpdateMembers¶
-
TemplateManager.
SaveFamilyAndUpdateMembers
¶ Save part family and update the family members supplied through input array.
It returns success and failure codes via errorCodes array. If errorCodes contains error about locked attributes, use
PartFamily.TemplateManager.GetInfoMessages
to query the names of those locked attributes.Signature
SaveFamilyAndUpdateMembers(forceUpdate, instDefsToUpdate)
Parameters: - forceUpdate (bool) –
- instDefsToUpdate (list of
NXOpen.PartFamily.InstanceDefinition
) –
Returns: Return type: list of int
New in version NX9.0.0.
License requirements: solid_modeling (“SOLIDS MODELING”)