Find the tag(label) about the model edge and face on STEP file.

Hi everyone,

I have read the edge or face tag(e.g. label: 0:1:1:5) of the IGES file by the methods of IGESCAFControl.
But the methods of STEPCAFControl are different from the IGESCAFControl.

I try similar methods to the SETP file but I can't get the label on the edge or face.

The file in the appendix is my STEP file, it's saved by SolidWorks(the image is my step file save options)

So if there's an idea to address this problem?

Thank you.

sOup x's picture

Did you try the following code? :

TCollection_AsciiString itemId;
TDF_Tool::Entry(theLabel, itemId);
Brian Lin's picture

I have tried this code but the itemId is returned null.

Dmitrii Pasukhin's picture

Hello,

XCAF structure do not depends on file format, that you read.
XCAF structure set label only for high level shapes and low-level, such as Edge, Vertex, Wire (e.i. subshapes of high level shape) in case with own attributes.
In other case no own labels for subshapes.

I recommend use special tools to work with documents - XCAFDoc_*.
For example, to get all shapes from the document use method GetFreeShapes from XCAFDoc_ShapeTool.
For iterate on subshape use special iterators, for example, TopoDS_Iterator or TopExp_Explorer

What about attached file, there is only one shape label (0:1:1:1) with own attributes (name + color)

Best regards, Dmitry.

Brian Lin's picture

Thank you, Dmitry Pasukhin,

I have tried the TopExp_Explorer to iterate the sub-shapes but it cost time if the shape is complicated.

I will try the other tool you provided.

Thanks again, Brian.