Please, give it a try. We are waiting for this feature for several years now, and it is essential for more complex 3D simulation models.
Thanks in advance,
HoWil
Moderator: bernd
Please, give it a try. We are waiting for this feature for several years now, and it is essential for more complex 3D simulation models.
Unfortunately, it does involve a big PR which I submitted over six months ago. I have since splitted that PR into three. This selection enhancement requires one of the essential piece that must be applied after the first two pieces.
oh we really need this selection tool for FEM!realthunder wrote: ↑Tue May 26, 2020 11:03 pmI have already implemented this. The core will have support of selecting all types of high level geometries.
compsolid-pick.gif
Code: Select all
msh1 = App.ActiveDocument.getObject('FEMMeshGmsh')
obj2 = msh1.MeshGroupList[0].References[0][0]
msh1.MeshGroupList[0].References = [(obj2,('Solid3',))] # FEMMeshGroup_Plate1
msh1.MeshGroupList[1].References = [(obj2,('Solid1',))] # FEMMeshGroup_Dielectricum
msh1.MeshGroupList[2].References = [(obj2,('Solid2',))] # FEMMeshGroup_Plate2
msh1.MeshGroupList[3].References = [(obj2,('Solid4',))] # FEMMeshGroup_Air
msh1.MeshRegionList[0].References = [(obj2,('Solid1',))] # FEMMeshRegion_Dielectricum
Code: Select all
def copySolidFacesGroup(solidGrp,faceGrp):
msh1 = App.ActiveDocument.getObject('FEMMeshGmsh')
obj1 = msh1.MeshGroupList[solidGrp].References[0][0] # Part::Feature object of CompSolid
solidIdx = int(msh1.MeshGroupList[solidGrp].References[0][1][0][5:])-1
fcs = ['Face'+str(i+1) for i, j in enumerate(obj1.Shape.Faces) if any([j.isSame(k) for k in obj1.Shape.Solids[solidIdx].Faces])] #find all Faces in the CompSolid which are shared with the Solids.
msh1.MeshGroupList[faceGrp].References=[(obj1,(fcs))]
Code: Select all
ElmerGrid 8 2 test3.unv -autoclean