FEM: mesh tools, better type checking

This commit is contained in:
Bernd Hahnebach
2020-03-02 20:36:46 +01:00
parent 3ae13a012a
commit a7ea47847a

View File

@@ -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(