Tue, 12/05/2023 - 07:08
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));
}
Tue, 12/05/2023 - 13:00
Hello, the problem on our side or invalid file.
We will create a bug and analyze it.
Best regards, Dmitrii.