Accessing Material Data
 
Functions Introduced:
The function ProMaterialCreate() creates a new material with the name you specify, and sets the default values within an associated ProMaterialdata object. Your application must set the correct material properties in the fields of the ProMaterialdata structure.
The input arguments of this function are as follows:
part — Specifies the part.
matl_name — Specifies the material name.
p_matl_data — This argument has been deprecated. Pass NULL to create an empty material item whose properties can be set by ProMaterialPropertySet().
The function ProPartMaterialsGet() obtains an array containing material names that exist in a part database. Note that you must use ProArrayAlloc() to allocate memory for this array. To remove a specified material from the part’s database, call the function ProMaterialDelete().
The current material of a part determines the material properties that will be used in some computational analyses of that part. Although multiple materials can be stored in a part database, only one material can be current. The function ProMaterialCurrentGet() gets the handle for the master material of the specified part. To set the master material, call the function ProMaterialCurrentSet().
When the master material on a part with a single body is changed, the appearance, density, and sheet metal properties of the body are updated. When you create a new body, it is automatically assigned the material assigned to the part. You can also explicitly assign a material to a body. In this case, even when the master material on the model is changed, the appearance, density, and sheet metal properties of the body are not changed.
By default, when assigning a material to a sheet metal part, the function ProMaterialCurrentSet() might modify the values of the sheet metal properties such as Y factor and bend table according to the material file definition. This triggers a modification of the developed length parameters of the sheet metal part. To prevent this modification, set the value of the configuration option material_update_smt_bend_table to never_replace. To trigger a modification of the developed length parameters of the sheet metal part, set the configuration option material_update_smt_bend_table to always_replace. The default value is always_replace. Call ProSolidRegenerate() to trigger the regeneration and recalculate the developed length dimension of the part.
See the Creo Parametric Sheetmetal online help for more information on Bend Allowance.
The function ProMaterialCurrentSet() may change the model display, if the new material has a default appearance assigned to it.
The function 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.
Was this helpful?