Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
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.
Solved! Go to Solution.
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.
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.