Category Solids and parts, Object ProMaterial

Function ProMaterialPropertySet


Description
Create or set a material property value.

The following combinations of arguments are permitted for p_value and p_units:

p_value

p_units

Is the property created in the material already?

Result

Any value

Appropriate units for this property, or NULL, if the property is unitless

NO

Property is created with the given units and value.

Any value

NULL

NO

Property is created with the given value using the appropriate units from the owner model.

Any value

Current units for this property, or NULL, if the property is unitless

YES

Property value is changed to the new value.

Any value

NULL

YES

Property value is changed to the new value (which is interpreted as being in the units from the owner model)

The current value

New appropriate units

YES

Property units are changed but the value is interpreted as being for the new units.

NULL

New appropriate units

YES

Property units are changed and the current value is converted to the new units.

Replacement in Object TOOLKIT: pfcMaterial::SetPropertyValue
pfcMaterial::SetPropertyUnits
Synopsis
#include <ProMaterial.h>
ProErrorProMaterialPropertySet(
ProMaterialItem* p_material
/* (In)
The material.
*/
ProMaterialPropertyType prop_type
/* (In)
The material property type.
*/
ProParamvalue* p_value
/* (In)
The material property value. Can be NULL, see the table above.
*/
ProUnititem* p_units
/* (In)
The material property units. Can be NULL, see the table above.
*/
)
Returns
PRO_TK_NO_ERRORThe function succeeded.
PRO_TK_BAD_INPUTSOne or more arguments is invalid.
PRO_TK_BAD_CONTEXTThis property cannot be created on the material (because other properties assigned to the material already do not permit it).
PRO_TK_NOT_VALIDThe new value for the property lies outside the permitted ranges for the property.
PRO_TK_INVALID_TYPEThe new units for the property are not correct for this property type.
PRO_TK_CANT_MODIFYCannot change the value of the property because it is driven by a parameter, relation or function.
PRO_TK_GENERAL_ERRORThe value type is incorrect for the property.

Manual References:

  1. Core: Solids, Parts, and Materials: Density
  2. Core: Solids, Parts, and Materials: Accessing Material Data
  3. Core: Solids, Parts, and Materials: Material Types and Properties
  4. Core: Solids, Parts, and Materials: Material Types and Properties
  5. Technical Summary of Changes for Creo 11.0.0.0: Functions superseded from Creo 1.0 to Creo 11.0
  6. Migrating to the Multibody Environment: Impact on Existing APIs

Sample Code References:

  1. pt_examples ( TestPartMaterial.c )
  2. pt_userguide ( UgSolidMaterial.c )
  3. pt_userguide ( UgSolidMaterial.c )
  4. pt_userguide ( UgSolidMaterial.c )
  5. pt_userguide ( UgSolidMaterial.c )
  6. pt_userguide ( UgSolidMaterial.c )