Fix bug in structural element generation when reference geom object is already a main shape

This commit is contained in:
barate 2012-05-15 09:49:22 +00:00
parent 818bbd4b49
commit 80804773f6

View File

@ -137,6 +137,8 @@ class StructuralElementPart:
self.name = name
self.geom = getGeompy(studyId)
self.baseShapesSet = set()
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:
@ -235,6 +237,8 @@ class StructuralElementPart:
"""
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)