Materials
Creo Object TOOLKIT C++ 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 Introduced:
The method
pfcMaterial::Save writes to a material file that can be imported into any
Creo part.
The method
pfcMaterial::Delete removes material from the part.
The method
pfcPart::GetCurrentMaterial returns the master material assigned for the part.
The method
pfcPart::SetCurrentMaterial sets the master material assigned to the part.
|
|
• By default, while assigning a master material to a sheetmetal part, the method pfcPart::SetCurrentMaterial 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 parameters of the sheetmetal part. To prevent this regeneration, set the value of the configuration option material_update_smt_bend_table to never_replace. To trigger a regeneration and a modification of the developed length parameters of the sheetmetal part, set the configuration option material_update_smt_bend_table to always_replace. The default value is always_replace.
• The method may also change the family table, if the parameter PTC_MASTER_MATERIAL is a part of the family table.
|
|
You can still use the legacy parameter PTC_MASTER_MATERIAL, however, these legacy parameters do not appear correctly in calculations and reports when you are working with a part that uses multiple materials.
|
|
The method
pfcPart::ListMaterials returns a list of the materials available in the part.
The method
pfcPart::CreateMaterial creates a new empty material in the specified part.
The method
pfcPart::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.
If the material is not already in the part database,
pfcPart::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.
Use the method
wfcWSolidBody::GetMaterial to retrieve the information of the material assigned to the body.
The method
wfcWSolidBody::SetMaterial assigns the material to the specified body.
|
|
Refer to the Creo Parametric online help for more information about Materials.
|