Skip to content

Commit

Permalink
FEM: Python base view object, reactivate get icon method
Browse files Browse the repository at this point in the history
  • Loading branch information
berndhahnebach committed Mar 10, 2020
1 parent 55bfa9d commit f41a942
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Mod/Fem/femguiobjects/ViewProviderFemConstraint.py
Expand Up @@ -48,9 +48,11 @@ def __init__(self, vobj):
# needs to be overwritten, if no standard icon name is used
def getIcon(self):
"""after load from FCStd file, self.icon does not exist, return constant path instead"""
# file_name = self.Object.Proxy.Type.replace("Fem::", "FEM_")
# return ":/icons/{}.svg".format(file_name)
return ""
# https://forum.freecadweb.org/viewtopic.php?f=18&t=44009
if hasattr(self.Object.Proxy, "Type") and self.Object.Proxy.Type.startswith("Fem::"):
return ":/icons/{}.svg".format(self.Object.Proxy.Type.replace("Fem::", "FEM_"))
else:
return ""

def attach(self, vobj):
default = coin.SoGroup()
Expand Down

0 comments on commit f41a942

Please sign in to comment.