I am trying to assign custom attributes to a subshape in an xcaf document that was generated by STEPCAFControl_Reader. None of ShapeTool's member functions FindMainShape, Search or SearchUsingMap return a non-null Label for the main shape. I created a map of the subshapes found in the document using TopExp::MapShapes on the shapes returned by ShapeTool::GetShapes. In this map I was able to find the subshape I was looking for.
How can I use ShapeTool to find the main shape or assembly?