Sat, 06/25/2022 - 12:36
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.
Attachments:
Mon, 06/27/2022 - 10:41
Did you try the following code? :
Wed, 06/29/2022 - 05:20
I have tried this code but the itemId is returned null.
Mon, 06/27/2022 - 11:18
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.
Wed, 06/29/2022 - 05:31
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.