parameters: (self)
docstring: after load from FCStd file, self.icon does not exist, return constant path instead
docstring_summary: after load from FCStd file, self.icon does not exist, return constant path instead
docstring_tokens: after load from FCStd file self . icon does not exist return constant path instead
function: def getIcon(self):
          """after load from FCStd file, self.icon does not exist, return constant path instead"""
          # https://forum.freecadweb.org/viewtopic.php?f=18&t=44009
          if not hasattr(self.Object, "Proxy"):
              FreeCAD.Console.PrintMessage("{}, has no Proxy.\n".format(self.Object.Name))
              return ""
          if not hasattr(self.Object.Proxy, "Type"):
              FreeCAD.Console.PrintMessage(
                  "{}: Proxy does has not have attribute Type.\n"
                  .format(self.Object.Name)
              )
              return ""
          if (
              isinstance(self.Object.Proxy.Type, string_types)
              and self.Object.Proxy.Type.startswith("Fem::")
          ):
              icon_path = "/icons/{}.svg".format(self.Object.Proxy.Type.replace("Fem::", "FEM_"))
              FreeCAD.Console.PrintLog("{} --> {}\n".format(self.Object.Name, icon_path))
              return ":/{}".format(icon_path)
          else:
              FreeCAD.Console.PrintError("No icon returned for {}\n".format(self.Object.Name))
              FreeCAD.Console.PrintMessage("{}\n".format(self.Object.Proxy.Type))
              return ""
function_tokens: def getIcon ( self ) : # https://forum.freecadweb.org/viewtopic.php?f=18&t=44009 if not hasattr ( self . Object , "Proxy" ) : FreeCAD . Console . PrintMessage ( "{}, has no Proxy.\n" . format ( self . Object . Name ) ) return "" if not hasattr ( self . Object . Proxy , "Type" ) : FreeCAD . Console . PrintMessage ( "{}: Proxy does has not have attribute Type.\n" . format ( self . Object . Name ) ) return "" if ( isinstance ( self . Object . Proxy . Type , string_types ) and self . Object . Proxy . Type . startswith ( "Fem::" ) ) : icon_path = "/icons/{}.svg" . format ( self . Object . Proxy . Type . replace ( "Fem::" , "FEM_" ) ) FreeCAD . Console . PrintLog ( "{} --> {}\n" . format ( self . Object . Name , icon_path ) ) return ":/{}" . format ( icon_path ) else : FreeCAD . Console . PrintError ( "No icon returned for {}\n" . format ( self . Object . Name ) ) FreeCAD . Console . PrintMessage ( "{}\n" . format ( self . Object . Proxy . Type ) ) return ""