self.name = name
self.geom = getGeompy(studyId)
self.baseShapesSet = set()
- mainShape = self.geom.GetMainShape(groupGeomObj)
- listIDs = self.geom.GetObjectIDs(groupGeomObj)
- if mainShape is not None and listIDs is not None:
- for id in listIDs:
- self.baseShapesSet.add(SubShapeID(mainShape, id))
+ self.isMainShape = groupGeomObj.IsMainShape()
+ if not self.isMainShape:
+ mainShape = self.geom.GetMainShape(groupGeomObj)
+ listIDs = self.geom.GetObjectIDs(groupGeomObj)
+ if mainShape is not None and listIDs is not None:
+ for id in listIDs:
+ self.baseShapesSet.add(SubShapeID(mainShape, id))
self.color = color
if self.color is None:
self.color = self._groupGeomObj.GetColor()
"""
Find and return the base sub-shapes in the structural element part.
"""
+ if self.isMainShape:
+ return [self._groupGeomObj]
subShapes = []
for subShapeID in self.baseShapesSet:
subShape = subShapeID.getObj(self.geom)