Define convection through Mechanical scripting
Pernelle Marone-Hitz
Member, Moderator, Employee Posts: 864
✭✭✭✭
Using ACT, I want to scan the geometry, select all the faces of a body named "Body1", and apply a convection condition on these faces
Tagged:
0
Answers
-
The following code can be used to that effect :
therm_analysis=ExtAPI.DataModel.Project.Model.Analyses[0] conv=therm_analysis.AddConvection() geo = ExtAPI.DataModel.GeoData for asm in geo.Assemblies: for part in asm.Parts: for body in part.Bodies: if body.Name == 'Body1': temp_sel=ExtAPI.SelectionManager.CreateSelectionInfo(SelectionTypeEnum.GeometryEntities) temp_list=[] for i in range(len(body.Faces)): temp_list.append(body.Faces[i].Id) temp_sel.Ids=temp_list conv.Location=temp_sel
6