Skip to main content
16-Pearl
December 16, 2015
Solved

Unit issue: assigning material

  • December 16, 2015
  • 1 reply
  • 1341 views

Hi there,

when I try to assign a material to a part using a *.mtl - file, the units in the mtl-file are ignored.

For instance

Young Modul:

"2300 MPa" becomes "2300 lbm/(in sec^2)" when I assign it via script (CurModel.CurrentMaterial = CurModel.RetrieveMaterial(material_name);)

"2300 MPa" becomes "41.0733 kPa " when I assign it via User Dialogue

I am using Creo 3.0 M050.


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
Best answer by Mat

I found a work around.

I change units after retrieving the material.

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);

The downside is, that all mtl-files have to be converted to those units.

1 reply

Mat16-PearlAuthorAnswer
16-Pearl
December 16, 2015

I found a work around.

I change units after retrieving the material.

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);

The downside is, that all mtl-files have to be converted to those units.