Exported PMI graphical presentation to STEP is not picked up by other CAD tools

When I export a STEP file with PMI data there is still something missing. The NIST step viewer and Autodesk Inventor don't seem to recognize the PMI data. If I load the exported STEP with my own code and try to find the relevant labels and attributes everything seems to be there. The only thing I think that's actually missing from the exported is the saved views. Could the missing views be the reason the other CAD tools ignore the PMI data? I noticed the documentation also says that views are not exported.

To make sure the problem is not in my code that adds the PMI data I made a minimal example that simply loads a STEP of a Box with 1 dimension PMI added, and then saves it again. Sure enough, the PMI data is no longer recognized by Inventor or the NIST step viewer. Is there something I'm missing in my export code?

std::string filename = "test.stp";
std::string filenameOut = "test_out.stp";

STEPCAFControl_Reader reader;
reader.SetColorMode(Standard_True);
reader.SetNameMode(Standard_True);
reader.SetLayerMode(Standard_True);
reader.SetGDTMode(Standard_True);
reader.SetViewMode(Standard_True);
reader.SetMetaMode(Standard_True);
reader.SetProductMetaMode(Standard_True);
reader.SetPropsMode(Standard_True);
reader.SetSHUOMode(Standard_True);
Interface_Static::SetCVal("read.step.schema", "AP242DIS");
Interface_Static::SetIVal("read.stepcaf.annot", 1);
Interface_Static::SetCVal("read.step.unit", "MM");

IFSelect_ReturnStatus status = reader.ReadFile(filename.c_str());
if (status != IFSelect_ReturnStatus::IFSelect_RetDone) 
{
    std::cerr << "Error reading STEP file: " << filename << std::endl;
    return 1;
}
Handle(TDocStd_Document) doc = new TDocStd_Document("OpenCascade");
reader.Transfer(doc);

Interface_Static::SetCVal("write.step.schema", "AP242DIS");
Interface_Static::SetIVal("write.stepcaf.annot", 1);
Interface_Static::SetCVal("write.step.unit", "MM");

STEPCAFControl_Writer writer;
writer.SetColorMode(Standard_True);
writer.SetNameMode(Standard_True);
writer.SetLayerMode(Standard_True);
writer.SetDimTolMode(Standard_True);
writer.SetPropsMode(Standard_True);
writer.SetNameMode(Standard_True);
writer.SetSHUOMode(Standard_True);
writer.Transfer(doc, STEPControl_AsIs);
writer.Write(filenameOut.c_str());
Dmitrii Pasukhin's picture

Hello, could you please share the minimum sample to validate. At the moment, XCAF do not provide tool to validate "minimum list of information". Probably some information was missed during creating of PMI.

Best regads, Dmitrii.

Dennis Meffert's picture

The input and output STEP files are attached. I just checked with yet another CAD viewer, and this one did in fact show the PMI. So the data is definitely there, but the saved views are missing and I think that might be what's tripping up Inventor and the NIST viewer. Is saved view export to STEP on the roadmap? I noticed it's already supported in the STEP reader.

Thank you!
Best, Dennis

Attachments: