The error when read step file with STEPControl_Reader.

jianbaoxia

CAD community veteran
Thank you for taking the time to look at my questions.

I have try to read my step file with the help of STEPControl_Reader.
There are my code:
Code:
    STEPControl_Reader step_reader;
    Standard_CString filepath = "C:\\Users\\14656\\Desktop\\sm-203.STEP";
    IFSelect_ReturnStatus status = step_reader.ReadFile(filepath);
    TopoDS_Shape step_shape;
    if (status == IFSelect_RetDone)
    {
        step_reader.TransferRoot(1);
        step_shape = step_reader.Shape();
        vout << step_shape;
        std::cout << status << "SUCCESS!" << std::endl;
    }
    else
        std::cout << status << "Sorry to fail!" << std::endl;

I try to open a simple step model, and it success:
1647083811332.png
However, when I try open a bigger model (400Mb) , it failed. But it can show on Analysis situs. So I thought there must have ways to slove it. But I have no ideas. Maybe I will try to set translation parameters.
1647084043671.png

I'm sorry that I can't share this step file for some reason. Bur I get it from a .prt file of UG.
 

jianbaoxia

CAD community veteran
I try to check the loaded file with STEPControl_Reader.PrintCheckLoad(failsonly,mode);
It doesn't seem to work
My code:
Code:
    STEPControl_Reader step_reader;
    Standard_CString filepath = "C:\\Users\\14656\\Desktop\\sm-203.STEP";
    step_reader.ReadFile(filepath);

    std::cout << "IFSelect_ItemsByEntity  :" << std::endl;
    step_reader.PrintCheckLoad(Standard_True, IFSelect_ItemsByEntity);
    std::cout << "IFSelect_CountByItem :" << std::endl;
    step_reader.PrintCheckLoad(Standard_True, IFSelect_CountByItem);
    std::cout << "IFSelect_ShortByItem :" << std::endl;
    step_reader.PrintCheckLoad(Standard_True, IFSelect_ShortByItem);
    std::cout << "IFSelect_ListByItem  :" << std::endl;
    step_reader.PrintCheckLoad(Standard_True, IFSelect_ListByItem);
    std::cout << "IFSelect_EntitiesByItem  :" << std::endl;
    step_reader.PrintCheckLoad(Standard_True, IFSelect_EntitiesByItem);
    std::cout << "IFSelect_CountSummary  :" << std::endl;
    step_reader.PrintCheckLoad(Standard_True, IFSelect_CountSummary);
    std::cout << "IFSelect_GeneralInfo  :" << std::endl;
    step_reader.PrintCheckLoad(Standard_True, IFSelect_GeneralInfo);
    std::cout << "IFSelect_Mapping  :" << std::endl;
    step_reader.PrintCheckLoad(Standard_True, IFSelect_Mapping);
    std::cout << "IFSelect_ResultCount  :" << std::endl;
    step_reader.PrintCheckLoad(Standard_True, IFSelect_ResultCount);

And the result:
1647087164010.png
 

jianbaoxia

CAD community veteran
I try it in pythocc in the same way, it works. My OCCT version is 7.6.0, also try 7.4.0, both failed.
 

jianbaoxia

CAD community veteran
I solved it. I'm so silly. It's just bucause the UTF-8 code in file name and path, this problem trouble me several days!!!
I have read the "load-step" in Analysis Situs , and it's also classic workflow, until I saw the issue of Quaoar. I was glad I had solved the problem, but more angry at myself for being stupid
 
Top