PrintCheckLoad(...) message meaning

Hello :)

I am hoping someone can give me some insight in the meaning of some messages I am getting when loading a STEP file using the STEPControl_Reader.
I am doing the most basic of basic loading, like this:

STEPControl_Reader reader;
IFSelect_ReturnStatus stat = reader.ReadFile(myFile);

And then I do a PrintCheckLoad(), including all messages, and displaying it by entity:

reader.PrintCheckLoad(false, IFSelect_ItemsByEntity);

I am doing this because I have a big STEP file ~800 mb that has some missing shapes when I try to load it in our project using OpenCascade, and I hope I can find something out from these messages and the Transfer messages as well.
The file is AP203, and created from SolidWorks 2019, using SwSTEP 2.0, according to the step header.

The PrintCheckLoad(...) mentions 250 entities, and I see 2 different types of messages:

-- Some of the messages are about an illegal type, for example:

Check: 4 -- Entity (n0:id) 125694:# 125695 Type:EDGE_LOOP
Parameter n0.2 (oriented_edge) : Entity has illegal type
Parameter n0.5 (oriented_edge) : Entity has illegal type

For this particular message, I looked in the STEP file, and entities 2 and 5 are of type VERTEX_POINT, while the others are ORIENTED_EDGE. I guess OpenCascade only allows ORIENTED_EDGE for an EDGE_LOOP?

Also, will OpenCascade still import this edge loop? Because it should be able to try to just ignore the vertices and try to create the edge loop from the oriented edges that *are* there, right?

-- Most of the messages are about a Standard_NoSuchObject Exception, for example:

Check: 2 -- Entity (n0:id) 26530:# 26536 Type:TOROIDAL_SURFACE
** Exception Raised during Check : Standard_NoSuchObject **

This I don't understand at all. So I tried to find this entity in the original STEP file:

# 26536 = TOROIDAL_SURFACE ( 'NONE', # 5471226, 0.9999999999999453770, 2.000000000000001776 ) ;
# 5471226 = AXIS2_PLACEMENT_3D ( 'NONE', # 4638889, # 7695737, # 3936265 ) ;
# 4638889 = CARTESIAN_POINT ( 'NONE', ( 114.9470228373221659, -4.736141352207567934, -319.0000000000008527 ) ) ;
# 7695737 = DIRECTION ( 'NONE', ( 1.000000000000000000, -2.775557561562741152E-14, 2.775557561562889142E-14 ) ) ;
# 3936265 = DIRECTION ( 'NONE', ( 2.775557561562889142E-14, 1.414070715952725985E-41, -1.000000000000000000 ) ) ;

I must be misunderstanding something, because to me everything seems to be present, and the values don't seem strange to me. So what is causing the Standard_NoSuchObject Exception? What object is it referring to? And what is wrong with it? How do I configure OpenCascade to load this without complaint?

Dmitry Pasukhin's picture

Thank you for your research.

From your post, I have identified 2 problems:
1. Incorrect parameter in the EDGE_LOOP (unexpected  VERTEX_POINT)
In this case, I think this point is degenerate, i.e. it is the same with the previous edge's end_point and the same with the next edge's start_point.
If it is, all are correct. If not, It can be a problem with the writer, because AP203e2:

Entity edge_loop has the following local and inherited explicit attributes:

Attribute Type Defined By
 name label (STRING) representation_item
 edge_list LIST OF oriented_edge (ENTITY) path

That is why we cannot read this case correctly.

2. Unexpected exception with TOROIDAL_SURFACE.

It can be seen that this torus is degenerate(the major radius is less than the minor one). From your example, I cannot find any problem. The entity dataset is not sufficient to reproduce or analyze the issue. If the issue is urgent, it is necessary to find all shared entities and analyze them. For example, all entities that content # 26536 as a parameter, then all entities that content these entities as a parameter and so on recursively.

Best regards,

Nathaniel Essenberg's picture

Thank you so much!

I did not realize those Torus parameters were the major and minor radius. I exchanged them manually in the file, just to test it, and the message no longer appears for that entity!
Now I wonder if there is any way to either change OpenCascade's settings or do some manual fixes in these kind of cases. Although I don't know if this is actually causing any problems, or if OpenCascade is already fixing this during Transfer and Shape Healing

linbei jianbaoxia's picture

I get a question, how long do you cost when load step file, my file is 400Mb, and it cost 14mins.
There is my code:
STEPControl_Reader step_reader;
IFSelect_ReturnStatus status = step_reader.ReadFile(argv[1]);

if (status != IFSelect_RetDone)
std::cout << "read" << argv[1] << "fail!" << std::endl;
return 1;

int num = step_reader.NbRootsForTransfer();
for (int i = 1; i <= num; i++) step_reader.TransferOneRoot(i);
TopoDS_Shapee = aShape = step_reader.Shape();