PhysicalMaterialCollection Class

class NXOpen.PhysicalMaterialCollection

Bases: object

Represents the collection of all NXOpen.PhysicalMaterial objects in this Part

To obtain an instance of this class, refer to NXOpen.MaterialManager

New in version NX5.0.0.

Methods

Method Description
AnyBodiesWithoutMaterial Returns true if there are bodies in the specified part that do not have a material assigned to them; false if all bodies in the part have a material assigned.
AnyBodiesWithoutPreferredMaterial Returns true if there are bodies that do not have the preferred material assigned to them and false if all bodies are assigned the preferred material.
CopyMaterialFromLibrary Creates an editable material (copy) in the part from a library material definition.
CopyMaterialItemRevision Creates an editable material (copy) in the part from a Teamcenter material item revision.
CreateListBlockBuilder Creates a NXOpen.PhysMat.PhysicalMaterialListBuilder that controls the physical materials list UI block look and feel as well as capturing the interactions so the values/settings can be journaled.
CreateMaterialAssignBuilder Creates a PhysMat.
CreateMaterialLibmgrBuilder Creates a PhysMat.
CreatePhysicalMaterialBuilder Creates a PhysMat.
CreatePhysicalMaterialEditBuilder Creates a PhysMat.
CreatePhysicalMaterialInspectBuilder Creates a PhysMat.
DeleteMaterialsFromLibrary Deletes the materials from a material library file.
ExportMaterialsToLibrary Writes out materials to a material library file.
FindBodiesWithoutMaterial Returns the bodies that don’t have a material assigned.
FindBodiesWithoutPreferredMaterial Returns the bodies that are not using the preferred material (either no material assigned or the non-preferred a different material assigned).
FindObject Finds the NXOpen.PhysicalMaterial with the given identifier as recorded in a journal.
GetLoadedLibraryMaterial Checks if a library material is loaded into a part file or not.
GetLoadedMaterialItemRevision Checks if a Teamcenter material item revision is loaded into a part file or not.
GetUsedMaterials Returns the materials used in the part
InfoItemRevision Displays the property values for the specified Teamcenter Material Item Revision in the information window.
InfoItemRevisionToFile Writes the property values for the specified Teamcenter Material Item Revision to a file.
InfoLibraryMaterial Displays the property values for the specified library material in the information window.
InfoLibraryMaterialToFile Writes the property values for the specified library material to a file.
LoadFromLegacynxlibrary Creates a non-editable material in the part from the legacy (phys_material.
LoadFromLibrary Creates a non-editable material in the part from a material library name.
LoadFromMatmlLibrary Creates a non-editable material in the part from a MatML file definition.
LoadFromNxlibrary Creates a non-editable material in the part from a NX Material Library definition.
LoadFromNxmatmllibrary Creates a non-editable material in the part from a NX MatML material definition.
LoadMaterialItemRevision Creates a non-editable material in the part from a Teamcenter material item revision.
OutputMaterialsToLibrary Writes out materials to a material library file.
UpdateMaterialsInLibrary Updates the materials in a material library file.

Method Detail

AnyBodiesWithoutMaterial

PhysicalMaterialCollection.AnyBodiesWithoutMaterial

Returns true if there are bodies in the specified part that do not have a material assigned to them; false if all bodies in the part have a material assigned.

Signature AnyBodiesWithoutMaterial()

Returns:
Return type:bool

New in version NX7.5.2.

License requirements: None.

AnyBodiesWithoutPreferredMaterial

PhysicalMaterialCollection.AnyBodiesWithoutPreferredMaterial

Returns true if there are bodies that do not have the preferred material assigned to them and false if all bodies are assigned the preferred material.

If there is not a preferred material specified, the return value is true.

Signature AnyBodiesWithoutPreferredMaterial()

Returns:
Return type:bool

New in version NX7.5.3.

License requirements: None.

CopyMaterialFromLibrary

PhysicalMaterialCollection.CopyMaterialFromLibrary

Overloaded method CopyMaterialFromLibrary

  • CopyMaterialFromLibrary(libraryName, libraryReference)
  • CopyMaterialFromLibrary(libraryName, libraryReference, retainParentPedigree)

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

Creates an editable material (copy) in the part from a library material definition.

Signature CopyMaterialFromLibrary(libraryName, libraryReference)

Parameters:
  • libraryName (str) – the fully qualified library name or if the leaf it will use the current directory, followed by the user and site directories set up in the customer defaults
  • libraryReference (str) – the material name/identifier
Returns:

the copied material

Return type:

NXOpen.PhysicalMaterial

New in version NX6.0.4.

License requirements: None.

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

Creates an editable material (copy) in the part from a library material definition.

Signature CopyMaterialFromLibrary(libraryName, libraryReference, retainParentPedigree)

Parameters:
  • libraryName (str) – the fully qualified library name or if the leaf it will use the current directory, followed by the user and site directories set up in the customer defaults
  • libraryReference (str) – the material name/identifier
  • retainParentPedigree (bool) – true indicates that the copied material should retain information about what library material it came from
Returns:

the copied material

Return type:

NXOpen.PhysicalMaterial

New in version NX8.5.0.

License requirements: None.

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

CopyMaterialItemRevision

PhysicalMaterialCollection.CopyMaterialItemRevision

Creates an editable material (copy) in the part from a Teamcenter material item revision.

Signature CopyMaterialItemRevision(pcMatlItem, pcRevisionID)

Parameters:
  • pcMatlItem (str) – the material item
  • pcRevisionID (str) – the revision identifier
Returns:

the copied material

Return type:

NXOpen.PhysicalMaterial

New in version NX7.5.3.

Deprecated since version NX12.0.0: Teamcenter material item revision is no longer supported.

License requirements: None.

CreateListBlockBuilder

PhysicalMaterialCollection.CreateListBlockBuilder

Creates a NXOpen.PhysMat.PhysicalMaterialListBuilder that controls the physical materials list UI block look and feel as well as capturing the interactions so the values/settings can be journaled.

Signature CreateListBlockBuilder()

Returns:created NXOpen.PhysMat.PhysicalMaterialListBuilder
Return type:NXOpen.PhysMat.PhysicalMaterialListBuilder

New in version NX6.0.0.

License requirements: None.

CreateMaterialAssignBuilder

PhysicalMaterialCollection.CreateMaterialAssignBuilder

Creates a PhysMat.

MaterialAssignBuilder that is used to control/set the material assign UI as well as to assign materials to bodies.

Signature CreateMaterialAssignBuilder()

Returns:created NXOpen.PhysMat.PhysicalMaterialAssignBuilder
Return type:NXOpen.PhysMat.PhysicalMaterialAssignBuilder

New in version NX6.0.0.

License requirements: None.

CreateMaterialLibmgrBuilder

PhysicalMaterialCollection.CreateMaterialLibmgrBuilder

Creates a PhysMat.

PhysicalMaterialLibMgrBuilder used by the material library manager UI to control the look and feel as well as capturing the interactions so the values/settings can be journaled.

Signature CreateMaterialLibmgrBuilder()

Returns:created NXOpen.PhysMat.PhysicalMaterialLibMgrBuilder
Return type:NXOpen.PhysMat.PhysicalMaterialLibMgrBuilder

New in version NX6.0.2.

License requirements: None.

CreatePhysicalMaterialBuilder

PhysicalMaterialCollection.CreatePhysicalMaterialBuilder

Creates a PhysMat.

PhysicalMaterialBuilder used to create a physical materials of a given type

Signature CreatePhysicalMaterialBuilder(materialType)

Parameters:materialType (NXOpen.PhysicalMaterialType) – Type of NXOpen.PhysicalMaterial to be created
Returns:created NXOpen.PhysicalMaterialBuilder
Return type:NXOpen.PhysicalMaterialBuilder

New in version NX6.0.0.

License requirements: None.

CreatePhysicalMaterialEditBuilder

PhysicalMaterialCollection.CreatePhysicalMaterialEditBuilder

Creates a PhysMat.

PhysicalMaterialBuilder used to edit physical materials.

Signature CreatePhysicalMaterialEditBuilder(physicalMaterial)

Parameters:physicalMaterial (NXOpen.PhysicalMaterial) – NXOpen.PhysicalMaterial to be edited
Returns:created NXOpen.PhysicalMaterialBuilder
Return type:NXOpen.PhysicalMaterialBuilder

New in version NX6.0.0.

License requirements: None.

CreatePhysicalMaterialInspectBuilder

PhysicalMaterialCollection.CreatePhysicalMaterialInspectBuilder

Creates a PhysMat.

PhysicalMaterialBuilder used to inspect physical materials.

Signature CreatePhysicalMaterialInspectBuilder(physicalMaterial)

Parameters:physicalMaterial (NXOpen.PhysicalMaterial) – NXOpen.PhysicalMaterial to be inspected
Returns:created NXOpen.PhysicalMaterialBuilder
Return type:NXOpen.PhysicalMaterialBuilder

New in version NX7.5.0.

License requirements: None.

DeleteMaterialsFromLibrary

PhysicalMaterialCollection.DeleteMaterialsFromLibrary

Deletes the materials from a material library file.

Write access is needed for this operation.

Signature DeleteMaterialsFromLibrary(pMatlNames, pcLibName)

Parameters:
  • pMatlNames (list of str) – Arrays of identifiers of the materials to be deleted from the library
  • pcLibName (str) – Library to modify

New in version NX6.0.2.

License requirements: None.

ExportMaterialsToLibrary

PhysicalMaterialCollection.ExportMaterialsToLibrary

Overloaded method ExportMaterialsToLibrary

  • ExportMaterialsToLibrary(pcMatlNames, pcLibNames, pcExportedLibName, bUpdateLibraryReference)
  • ExportMaterialsToLibrary(pcMatlNames, pcLibNames, pcExportedLibName, bUpdateLibraryReference)

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

Writes out materials to a material library file. These materials can be local material definitions or material definitions from other material libraries. The combination of the material name and library name identify a material definition. If the material definition is for a local material, the name is specified and the library name is specified as “”. Write access is needed for the Exported library. If the bUpdateLibraryReferences is set to true, the NX model is updated to reflect the exported library as the library the material is now referenced in. Each material can have its own bUpdateLibraryReferences in this version of the JA call.

Signature ExportMaterialsToLibrary(pcMatlNames, pcLibNames, pcExportedLibName, bUpdateLibraryReference)

Parameters:
  • pcMatlNames (list of str) – Array of identifiers of the materials to be exported
  • pcLibNames (list of str) – Array of library names corresponding to the material names
  • pcExportedLibName (str) – The library to write the material definitions to
  • bUpdateLibraryReference (list of bool) – true indicates that the library reference of loaded/local materials should now refer to the exported library, false indicates the library reference should remain unchanged

New in version NX11.0.2.

License requirements: None.

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

Writes out materials to a material library file. These materials can be local material definitions or material definitions from other material libraries. The combination of the material name and library name identify a material definition. If the material definition is for a local material, the name is specified and the library name is specified as “”. Write access is needed for the Exported library. If the bUpdateLibraryReferences is set to true, the NX model is updated to reflect the exported library as the library the material is now referenced in.

Signature ExportMaterialsToLibrary(pcMatlNames, pcLibNames, pcExportedLibName, bUpdateLibraryReference)

Parameters:
  • pcMatlNames (list of str) – Array of identifiers of the materials to be exported
  • pcLibNames (list of str) – Array of library names corresponding to the material names
  • pcExportedLibName (str) – The library to write the material definitions to
  • bUpdateLibraryReference (bool) – true indicates that the library reference of loaded/local materials should now refer to the exported library, false indicates the library reference should remain unchanged

New in version NX7.5.2.

License requirements: None.

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

FindBodiesWithoutMaterial

PhysicalMaterialCollection.FindBodiesWithoutMaterial

Returns the bodies that don’t have a material assigned.

Signature FindBodiesWithoutMaterial()

Returns:the array of bodies without a material
Return type:list of NXOpen.TaggedObject

New in version NX7.5.2.

License requirements: None.

FindBodiesWithoutPreferredMaterial

PhysicalMaterialCollection.FindBodiesWithoutPreferredMaterial

Returns the bodies that are not using the preferred material (either no material assigned or the non-preferred a different material assigned).

Signature FindBodiesWithoutPreferredMaterial()

Returns:the array of bodies not using preferred material
Return type:list of NXOpen.TaggedObject

New in version NX7.5.2.

License requirements: None.

FindObject

PhysicalMaterialCollection.FindObject

Finds the NXOpen.PhysicalMaterial with the given identifier as recorded in a journal.

An exception will be thrown if no object can be found with the given journal identifier.

Signature FindObject(journalIdentifier)

Parameters:journalIdentifier (str) – Identifier to be found
Returns:material found
Return type:NXOpen.Material

New in version NX5.0.0.

License requirements: None.

GetLoadedLibraryMaterial

PhysicalMaterialCollection.GetLoadedLibraryMaterial

Checks if a library material is loaded into a part file or not.

If it is, the loaded material is returned.

Signature GetLoadedLibraryMaterial(pcLibName, pcMatlName)

Parameters:
  • pcLibName (str) – the fully qualified library name or if the leaf it will use the current directory, followed by the user and site directories set up in the customer defaults
  • pcMatlName (str) – the material name
Returns:

the loaded material

Return type:

NXOpen.PhysicalMaterial

New in version NX7.5.3.

License requirements: None.

GetLoadedMaterialItemRevision

PhysicalMaterialCollection.GetLoadedMaterialItemRevision

Checks if a Teamcenter material item revision is loaded into a part file or not.

If it is, the loaded material is returned.

Signature GetLoadedMaterialItemRevision(pcMatlItem, pcRevisionID)

Parameters:
  • pcMatlItem (str) – the material item
  • pcRevisionID (str) – the revision identifier
Returns:

the loaded material

Return type:

NXOpen.PhysicalMaterial

New in version NX7.5.3.

Deprecated since version NX12.0.0: Teamcenter material item revision is no longer supported.

License requirements: None.

GetUsedMaterials

PhysicalMaterialCollection.GetUsedMaterials

Returns the materials used in the part

Signature GetUsedMaterials()

Returns:Materials used
Return type:list of NXOpen.PhysicalMaterial

New in version NX8.0.1.

License requirements: None.

InfoItemRevision

PhysicalMaterialCollection.InfoItemRevision

Displays the property values for the specified Teamcenter Material Item Revision in the information window.

Signature InfoItemRevision(pcMaterialItem, pcRevision)

Parameters:
  • pcMaterialItem (str) – the material item
  • pcRevision (str) – the revision identifier

New in version NX7.5.3.

Deprecated since version NX12.0.0: Teamcenter material item revision is no longer supported.

License requirements: None.

InfoItemRevisionToFile

PhysicalMaterialCollection.InfoItemRevisionToFile

Writes the property values for the specified Teamcenter Material Item Revision to a file.

Signature InfoItemRevisionToFile(pcMaterialItem, pcRevision, bOverride, pcFileName)

Parameters:
  • pcMaterialItem (str) – the material item
  • pcRevision (str) – the revision identifier
  • bOverride (bool) – if the file already exists, true override the file, false append to the file
  • pcFileName (str) – the full path including filename of file where the information should be written

New in version NX7.5.3.

Deprecated since version NX12.0.0: Teamcenter material item revision is no longer supported.

License requirements: None.

InfoLibraryMaterial

PhysicalMaterialCollection.InfoLibraryMaterial

Displays the property values for the specified library material in the information window.

Signature InfoLibraryMaterial(pcLibAr, pcMatlNameAr)

Parameters:
  • pcLibAr (str) – the library name
  • pcMatlNameAr (str) – the material name

New in version NX7.5.3.

License requirements: None.

InfoLibraryMaterialToFile

PhysicalMaterialCollection.InfoLibraryMaterialToFile

Writes the property values for the specified library material to a file.

Signature InfoLibraryMaterialToFile(pcLibAr, pcMatlNameAr, bOverride, pcFileName)

Parameters:
  • pcLibAr (str) – the library name
  • pcMatlNameAr (str) – the material name
  • bOverride (bool) – if the file already exists, true override the file, false append to the file
  • pcFileName (str) – the full path including filename of file where the information should be written

New in version NX7.5.3.

License requirements: None.

LoadFromLegacynxlibrary

PhysicalMaterialCollection.LoadFromLegacynxlibrary

Creates a non-editable material in the part from the legacy (phys_material.

dat) material library definition. The material is identified by the unique material identifier in the phys_material.dat file.

Signature LoadFromLegacynxlibrary(libraryReference)

Parameters:libraryReference (str) – the unique library reference for a material in this Library
Returns:the loaded material
Return type:NXOpen.PhysicalMaterial

New in version NX7.5.0.

License requirements: None.

LoadFromLibrary

PhysicalMaterialCollection.LoadFromLibrary

Creates a non-editable material in the part from a material library name.

Signature LoadFromLibrary(pcLibName, pcMatlName)

Parameters:
  • pcLibName (str) – the fully qualified library name or if the leaf it will use the current directory, followed by the user and site directories set up in the customer defaults
  • pcMatlName (str) – the material name
Returns:

the loaded material

Return type:

NXOpen.PhysicalMaterial

New in version NX7.5.3.

License requirements: None.

LoadFromMatmlLibrary

PhysicalMaterialCollection.LoadFromMatmlLibrary

Creates a non-editable material in the part from a MatML file definition.

The material is identified by the library name and the unique material name. If the library name is not fully qualified, it will attempt to find a MatML library with this name in the current directory, followed by the specified customer defaults values for the user and site MatML libraries. If the customer defaults are using the file format, it will look in the directory where the specified file is located.

Signature LoadFromMatmlLibrary(libraryName, materialName)

Parameters:
  • libraryName (str) – the fully qualified library name or if the leaf it will use the current directory, followed by the user and site directories set up in the customer defaults
  • materialName (str) – the material name
Returns:

the loaded material

Return type:

NXOpen.PhysicalMaterial

New in version NX6.0.2.

License requirements: None.

LoadFromNxlibrary

PhysicalMaterialCollection.LoadFromNxlibrary

Creates a non-editable material in the part from a NX Material Library definition.

It is preferable to use either NX MatML or NX Legacy library versions as they will have better performance.

Signature LoadFromNxlibrary(libraryReference)

Parameters:libraryReference (str) – the unique library reference for a material in this Library
Returns:the loaded material
Return type:NXOpen.PhysicalMaterial

New in version NX6.0.0.

License requirements: None.

LoadFromNxmatmllibrary

PhysicalMaterialCollection.LoadFromNxmatmllibrary

Creates a non-editable material in the part from a NX MatML material definition.

Signature LoadFromNxmatmllibrary(materialName)

Parameters:materialName (str) – the unique material name from within this Library
Returns:the loaded material
Return type:NXOpen.PhysicalMaterial

New in version NX7.5.0.

License requirements: None.

LoadMaterialItemRevision

PhysicalMaterialCollection.LoadMaterialItemRevision

Creates a non-editable material in the part from a Teamcenter material item revision.

Signature LoadMaterialItemRevision(pcMatlItem, pcRevisionID)

Parameters:
  • pcMatlItem (str) – the material item
  • pcRevisionID (str) – the revision identifier
Returns:

the loaded material

Return type:

NXOpen.PhysicalMaterial

New in version NX7.5.3.

Deprecated since version NX12.0.0: Teamcenter material item revision is no longer supported.

License requirements: None.

OutputMaterialsToLibrary

PhysicalMaterialCollection.OutputMaterialsToLibrary

Writes out materials to a material library file.

These materials can be local material definitions or material definitions from other material libraries. The combination of the material name and library name identify a material definition. If the material definition is for a local material, the name is specified and the library name is specified as “”. Write access is needed for the Exported library.

Signature OutputMaterialsToLibrary(pcMatlNames, pcLibNames, pcExportedLibName)

Parameters:
  • pcMatlNames (list of str) – Array of identifiers of the materials to be exported
  • pcLibNames (list of str) – Array of library names corresponding to the material names
  • pcExportedLibName (str) – The library to write the material definitions to

New in version NX6.0.2.

License requirements: None.

UpdateMaterialsInLibrary

PhysicalMaterialCollection.UpdateMaterialsInLibrary

Updates the materials in a material library file.

Write access is needed for this operation.

Signature UpdateMaterialsInLibrary(tEditedMatl, pMatlNames, pcLibName)

Parameters:
  • tEditedMatl (list of NXOpen.PhysicalMaterial) – Array of loaded material tags
  • pMatlNames (list of str) – Array of the material names which match the name in the library that should take the properties of the corresponding material (tEditedMatl)
  • pcLibName (str) – Library to modify

New in version NX6.0.2.

License requirements: None.