Skip to content

Commit

Permalink
[FEM] Selection: fix error for 2D shapes
Browse files Browse the repository at this point in the history
- 2D shapes have no "Shape" attribute. This attribute was accessed before checked it it exists
  • Loading branch information
donovaly committed Aug 12, 2022
1 parent ed3625a commit bd796c9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Mod/Fem/femguiutils/selection_widgets.py
Expand Up @@ -479,12 +479,12 @@ def add_references(self):
self.sel_server = FemSelectionObserver(self.selectionParser, print_message)

def selectionParser(self, selection):
FreeCAD.Console.PrintMessage("Selection: {} {} {}\n".format(
selection[0].Shape.ShapeType,
selection[0].Name,
selection[1]
))
if hasattr(selection[0], "Shape") and selection[1]:
FreeCAD.Console.PrintMessage("Selection: {} {} {}\n".format(
selection[0].Shape.ShapeType,
selection[0].Name,
selection[1]
))
sobj = selection[0]
elt = sobj.Shape.getElement(selection[1])
ele_ShapeType = elt.ShapeType
Expand Down

0 comments on commit bd796c9

Please sign in to comment.