cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Assinging materials in Creo via Weblink

No ratings

Usually, You assign a material using

oSession = pfcCreate("MpfcCOMGlobal").GetProESession(); 

CurModel = oSession.CurrentModel; 

CurModel.CurrentMaterial = CurModel.RetrieveMaterial(material_name);


But there is a catch.

This code line only imports the number of a certain value. The unit described in the imported *.mtl file is ignored. You have to set units manually by using:


CurModel.CurrentMaterial = CurModel.RetrieveMaterial(material_name);

CurModel.CurrentMaterial.SetPropertyUnits(pfcCreate("pfcMaterialPropertyType").MTL_PROP_MASS_DENSITY, "kg/mm^3", false);  

CurModel.CurrentMaterial.SetPropertyUnits(pfcCreate("pfcMaterialPropertyType").MTL_PROP_YOUNG_MODULUS, "MPa", false); 

CurModel.CurrentMaterial.SetPropertyUnits(pfcCreate("pfcMaterialPropertyType").MTL_PROP_THERMAL_EXPANSION_COEFFICIENT, "/ K", false); 

CurModel.CurrentMaterial.SetPropertyUnits(pfcCreate("pfcMaterialPropertyType").MTL_PROP_SPECIFIC_HEAT, "joule / (kg K)", false); 

CurModel.CurrentMaterial.SetPropertyUnits(pfcCreate("pfcMaterialPropertyType").MTL_PROP_THERMAL_CONDUCTIVITY , "W/(m K)", false); 

Version history
Last update:
‎Feb 15, 2016 03:49 AM
Updated by:
13-Aquamarine