Materials
the VB API enables you to programmatically access the material types and properties of parts. Using the methods and properties described in the following sections, you can perform the following actions:
• Create or delete materials
• Set the current material
• Access and modify the material types and properties
Methods and Properties Introduced:
The method
IpfcMaterial.Save() writes to a material file that can be imported into any
Creo+ part.
The method
IpfcMaterial.Delete() removes material from the part.
The property
IpfcPart.CurrentMaterial returns and sets the material assigned to the part.
|
|
By default, while assigning a material to a sheetmetal part, the property IpfcPart.CurrentMaterial modifies the values of the sheetmetal properties such as Y factor and bend table according to the material file definition. This modification triggers a regeneration and a modification of the developed length calculations of the sheetmetal part. However, you can avoid this behavior by setting the value of the configuration option material_update_smt_bend_table to never_replace
The property IpfcPart.CurrentMaterial may change the model display, if the new material has a default appearance assigned to it.
The property may also change the family table, if the parameter PTC_MATERIAL_NAME is a part of the family table.
|
The method
IpfcPart.ListMaterials() returns a list of the materials available in the part.
The method
IpfcPart.CreateMaterial() creates a new empty material in the specified part.
The method
IpfcPart.RetrieveMaterial() imports a material file into the part. The name of the file read can be as either:
• <name>.mtl—Specifies the new material file format.
• <name>.mat—Specifies the material file format prior to Pro/ENGINEER Wildfire 3.0.
If the material is not already in the part database,
IpfcPart.RetrieveMaterial() adds the material to the database after reading the material file. If the material is already in the database, the function replaces the material properties in the database with those contained in the material file.