diff --git a/src/Mod/Fem/femmesh/meshtools.py b/src/Mod/Fem/femmesh/meshtools.py index e3e06fda01..09d2ba519c 100644 --- a/src/Mod/Fem/femmesh/meshtools.py +++ b/src/Mod/Fem/femmesh/meshtools.py @@ -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(