How can i get the meshgroups name in FEMMesh which import from UNV file?

About the development of the FEM module/workbench.

Moderator: bernd

Post Reply
x70
Posts: 14
Joined: Mon Oct 05, 2020 3:42 pm

How can i get the meshgroups name in FEMMesh which import from UNV file?

Post by x70 »

i import a FEMmesh from unv file,the meshobject in treeview have some attributes are liseted in propertiese table,included groups count,but no othor groups information like group name,How can I get them via python command?
x70
Posts: 14
Joined: Mon Oct 05, 2020 3:42 pm

Re: How can i get the meshgroups name in FEMMesh which import from UNV file?

Post by x70 »

I write like this:

Code: Select all

 Fem.insert(filePath,FreeCAD.activeDocument().Name)
 mesh = FreeCAD.ActiveDocument.FEMMeshGmsh.FemMesh
 for g in mesh.Groups:
       name = mesh.getGroupName(g)
       print(name)
       mesh.getGroupElementType(g)
       mesh.getGroupElements(g)
but got:

Code: Select all

'App.Document' object has no attribute 'FEMMeshGmsh'
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: How can i get the meshgroups name in FEMMesh which import from UNV file?

Post by bernd »

Code: Select all

 mesh = FreeCAD.ActiveDocument.FEMMeshGmsh.FemMesh
FEMMeshGmsh is the name of the fem mesh object. If you import a unv the object name is the file name. You can post an example FreeCAD file if it still does not work for you.
Post Reply