STEP Import: material, density

Hello community,

I am trying to read the part's density from a STEP-file exported from Pro/Engineer Wildfire 5. I tested different export options all including density (AP_203_is_ext, AP_203_e2, AP_214_is,...).

The density is represented as:

I also tried to import the STEP-file ... also in this case no success.

Finally some information about my import strategy:

STEPCAFControl_Reader reader;
Handle(XCAFApp_Application) anApp = XCAFApp_Application::GetApplication();
anApp->NewDocument("MDTV-XCAF", m_doc);

// enable all modes ... I also tried differnt combinations
reader.SetMatMode(true); //this should be the important thing for density true?

if ( reader.Transfer( m_doc ) )
Handle(XCAFDoc_ShapeTool) aShapeTool = XCAFDoc_DocumentTool::ShapeTool(m_doc->Main());
Handle(XCAFDoc_ColorTool) myColors = XCAFDoc_DocumentTool::ColorTool(m_doc->Main());
Handle(XCAFDoc_MaterialTool) myMaterials = XCAFDoc_DocumentTool::MaterialTool(m_doc->Main());

TDF_LabelSequence mat;
cout }

Unfortunately the program always prints out:
"Num of StepLoader Materials:0"

The following always returns density=0
const TDF_Label &label = sequence.Value(i+1);
if (aShapeTool->IsShape(label)){
TopoDS_Shape s = aShapeTool->GetShape(label);
double density=myMaterials->GetDensityForShape(label);

Has anyone ideas how to solve this problem? How must a density be represented in a STEP-file to be imported? Is the material interface already implemented? I found no documentation about this feature.

Thanks in advance,

Matthias Kennel

kennel's picture

I added a new material loading method in the Step-Loader to support the STEP export of PTC Pro/Engineer WF 5. I would like to contribute it to the community for the nexte version of OC. Ha anyone an idea how to do this?

Matthias Kennel

Pierre Juillard's picture

Hi Matthias,

I am not export on this topic, but yous should consider having a look to SCL project for STEP import/export (

If I understand well, this open source library is being included in OCE, the open source version of OCC, maintained by the community (

You should thus simply have a look to see if the functionality you are interested in is not already managed by SCL.

If so, you should just end up to use OCE (which is if I understand still well) binary compatible with OCC in your own project.

Have a good day.


Forum supervisor's picture

Dear Matthias,
In order to take advantage of the proposed cotribution, we are bound to sign the CLA Agreement with you.
So, we suggest you to register at the contribution portal -
and consider a possibility to sign the CLA according the procedure published on that site.