def makeMeshGroup(doc, base_mesh, use_label=False, name="FEMMeshGroup"): '''makeMeshGroup(document, base_mesh, [use_label], [name]): creates a FEM mesh region object to define properties for a region of a FEM mesh''' obj = doc.addObject("Fem::FeaturePython", name) from femobjects import _FemMeshGroup _FemMeshGroup._FemMeshGroup(obj) obj.UseLabel = use_label # obj.BaseMesh = base_mesh # App::PropertyLinkList does not support append, we will use a temporary list to append the mesh group obj. to the list tmplist = base_mesh.MeshGroupList tmplist.append(obj) base_mesh.MeshGroupList = tmplist if FreeCAD.GuiUp: from femguiobjects import _ViewProviderFemMeshGroup _ViewProviderFemMeshGroup._ViewProviderFemMeshGroup(obj.ViewObject) return obj