Skip to content

Commit

Permalink
FEM: mesh tools, better type checking
Browse files Browse the repository at this point in the history
  • Loading branch information
berndhahnebach committed Mar 2, 2020
1 parent b73cc1a commit d52cde9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/Mod/Fem/femmesh/meshtools.py
Expand Up @@ -732,15 +732,16 @@ def get_elset_short_name(
obj,
i
):
if hasattr(obj, "Proxy") and obj.Proxy.Type == "Fem::Material":
from femtools.femutils import is_of_type
if is_of_type(obj, "Fem::Material"):
return "M" + str(i)
elif hasattr(obj, "Proxy") and obj.Proxy.Type == "Fem::FemElementGeometry1D":
elif is_of_type(obj, "Fem::FemElementGeometry1D"):
return "B" + str(i)
elif hasattr(obj, "Proxy") and obj.Proxy.Type == "Fem::FemElementRotation1D":
elif is_of_type(obj, "Fem::FemElementRotation1D"):
return "R" + str(i)
elif hasattr(obj, "Proxy") and obj.Proxy.Type == "Fem::FemElementFluid1D":
elif is_of_type(obj, "Fem::FemElementFluid1D"):
return "F" + str(i)
elif hasattr(obj, "Proxy") and obj.Proxy.Type == "Fem::FemElementGeometry2D":
elif is_of_type(obj, "Fem::FemElementGeometry2D"):
return "S" + str(i)
else:
FreeCAD.Console.PrintError(
Expand Down

0 comments on commit d52cde9

Please sign in to comment.