Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
FEM: mesh group object, move make def into make objects FEM module
  • Loading branch information
berndhahnebach authored and wwmayer committed Feb 21, 2017
1 parent c5008f9 commit b7d69d9
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 53 deletions.
1 change: 0 additions & 1 deletion src/Mod/Fem/App/CMakeLists.txt
Expand Up @@ -126,7 +126,6 @@ SET(FemScripts_SRCS
FemInputWriterCcx.py
FemInputWriterZ88.py
FemMesh2Mesh.py
FemMeshGroup.py
FemMeshRegion.py
FemMeshTools.py
FemTools.py
Expand Down
1 change: 0 additions & 1 deletion src/Mod/Fem/CMakeLists.txt
Expand Up @@ -56,7 +56,6 @@ INSTALL(
FemMesh2Mesh.py
_CommandFEMMesh2Mesh.py

FemMeshGroup.py
_FemMeshGroup.py
_ViewProviderFemMeshGroup.py
_CommandMeshGroup.py
Expand Down
49 changes: 0 additions & 49 deletions src/Mod/Fem/FemMeshGroup.py

This file was deleted.

17 changes: 17 additions & 0 deletions src/Mod/Fem/ObjectsFem.py
Expand Up @@ -260,6 +260,23 @@ def makeMeshGmsh(name="FEMMeshGMSH"):
return obj


def makeMeshGroup(base_mesh, use_label=False, name="FEMMeshGroup"):
'''makeMeshGroup([length], [name]): creates a FEM mesh region object to define properties for a regon of a FEM mesh'''
obj = FreeCAD.ActiveDocument.addObject("Fem::FeaturePython", name)
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:
import _ViewProviderFemMeshGroup
_ViewProviderFemMeshGroup._ViewProviderFemMeshGroup(obj.ViewObject)
return obj


'''
# print supportedTypes
App.newDocument()
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Fem/_CommandMeshGroup.py
Expand Up @@ -45,12 +45,12 @@ def __init__(self):

def Activated(self):
FreeCAD.ActiveDocument.openTransaction("Create FemMeshGroup")
FreeCADGui.addModule("FemMeshGroup")
FreeCADGui.addModule("ObjectsFem")
sel = FreeCADGui.Selection.getSelection()
if (len(sel) == 1):
sobj = sel[0]
if len(sel) == 1 and hasattr(sobj, "Proxy") and sobj.Proxy.Type == "FemMeshGmsh":
FreeCADGui.doCommand("FemMeshGroup.makeFemMeshGroup(App.ActiveDocument." + sobj.Name + ")")
FreeCADGui.doCommand("ObjectsFem.makeMeshGroup(App.ActiveDocument." + sobj.Name + ")")

FreeCADGui.Selection.clearSelection()

Expand Down

0 comments on commit b7d69d9

Please sign in to comment.