Can't open .step file

hi guys.I can't open some .step when i using opencascade.but It can be open by solidworks normally,I don't know what's wrong with this file or my code,here is my code:

STEPControl_Reader aReader;

auto sss = string_To_UTF8(aFileName);
IFSelect_ReturnStatus status = aReader.ReadFile(sss.c_str());
if (status != IFSelect_RetDone)
return status;
aReader.WS()->TransferReader()->TransientProcess()->SetTraceLevel(2);
Standard_Boolean failsonly = Standard_False;
aReader.PrintCheckLoad(failsonly, IFSelect_ItemsByEntity);
Standard_Integer nbr = aReader.NbRootsForTransfer();
aReader.PrintCheckTransfer(failsonly, IFSelect_ItemsByEntity);
for (Standard_Integer n = 1; n {
Standard_Boolean ok = aReader.TransferRoot(n);
}
Standard_Integer nbs = aReader.NbShapes();
if (nbs == 0)
{
return IFSelect_RetVoid;
}
// save
for (Standard_Integer i = 1; i {
aHSequenceOfShape.push_back(aReader.Shape(i));
}

Dmitrii Pasukhin's picture

Hello, the problem on our side or invalid file.

We will create a bug and analyze it.

        *****************************************************************
        ********  Loaded File : d:/test_.STEP                    ********
        *****************************************************************
        ********  Model : 80863 Entities, of which 137 Root(s)
        *****************************************************************

Check Model Complete Check List : F:FACE_OUTER_BOUND: Parameter n0.2 (bound) : Entity has illegal type
  - Nb: 1 :   23888:#23888
Check Model Complete Check List : F:EDGE_CURVE: ** Exception Raised during Check : Standard_NoSuchObject **
  - Nb: 4 :   24412:#24412  41832:#41832  48028:#48028  52387:#52387
 Nb Total:5  for 2 items

There are 80863 Entities, of which 137 Root(s)

Best regards, Dmitrii.