Fri, 06/02/2023 - 11:04
Hi,
I'm having some issues trying to get all attributes associated to a specific label.
Scenario:
Right now I'm focused on getting Materials, Colors and Names from a label. As I can see all of them are attributes:
https://dev.opencascade.org/doc/refman/html/class_t_d_f___attribute.html
My main idea was to iterate all over the attributes TDF_AttributeIterator attrIter(label); but the only attributes that I'm finding are the ones related to TDataStd_TreeNode, TDataStd_Name... but no attributes related to colors.
If I use the GetColor() from XCAFDoc_ColorTool with the same label I get colors...
What I'm not understanding about attributes? Shouldn't I get colors with the AttributeIterator?
Best regards.
Fri, 06/02/2023 - 11:41
Hello,
Color is not an attirbute, it is a reference on ColorLabel. So, when you call GetColor() you get reference ColorLabel and extract Color from ColorLabel, that exist on 0:1:2 label
Best regards, Dmitrii.
Fri, 06/02/2023 - 12:44
In that case seeing the previous link that I attached on the post, XCAFDoc_ColorTool could be an attribute and could be used to extract colors?
By the way, the screenshots that you attached come from a specific tool? Seems very useful to investigate the tree structure of a CAD...
Best regards!
Fri, 06/02/2023 - 13:04
Color is an attribute. But attribute attached to the ColorLabel.
It is QT application named "Inspector", part of OCCT repo. You can build it by youreself, or dowload full installation from Download - Open CASCADE Technology
Documentation: Inspector - Open CASCADE Technology Documentation
Best regards, Dmitrii.
Fri, 06/02/2023 - 13:23
If you working on copying labels. Please take a look into XCafDoc_Editor::CopyLabels (occt 7.7.0 and above). It helps to copy ShLabels with attached attributes.
Best regards, Dmitrii.