How can I define thermal fluid behavior to beam bodies in Mechanical through scripting?
Pernelle Marone-Hitz
Member, Moderator, Employee Posts: 871
✭✭✭✭
Using ACT, how can I loop through all the bodies in the Mechanical tree, and change the model type for all beam bodies to "thermal fluid" ?
Tagged:
2
Answers
-
Here is a script that will loop through all bodies and parts in the tree and change the model type for all beam bodies :
geodata=ExtAPI.DataModel.Project.Model.Analyses[0].GeoData geo = ExtAPI.DataModel.Project.Model.Geometry for i in range(len(geodata.Assemblies[0].Parts)): for j in range(len(geodata.Assemblies[0].Parts[i].Bodies)): bodygeo=geo.Children[i].Children[j] bodygeodata=geodata.Assemblies[0].Parts[i].Bodies[j] if str(bodygeodata.BodyType)=='GeoBodyWire': bodygeo.ModelType=PrototypeModelType.ModelPhysicsTypeFluid
4