Using ACT, how can I loop through each bodies of the model, insert a total deformation result for th
Options
![Pernelle Marone-Hitz](https://us.v-cdn.net/6037473/uploads/userpics/4AG2SAGAOHUA/nTB4DQJCWAJV4.jpg)
Pernelle Marone-Hitz
Member, Moderator, Employee Posts: 831
![Ansys Employee](https://us.v-cdn.net/6037473/uploads/badges/RVRDV39KPJ91.png)
![Solution Developer Community of Practice Member](https://us.v-cdn.net/6037473/uploads/badges/274G8C56SBE6.png)
Using ACT, how can I loop through each bodies of the model, insert a total deformation result for this body, and export the result to a .stl file ?
Tagged:
0
Answers
-
The following script can be used. Please note the export folder should exist prior to using this code.
solution = ExtAPI.DataModel.Project.Model.Analyses[0].Solution geo = ExtAPI.DataModel.GeoData for asm in geo.Assemblies: for part in asm.Parts: for body in part.Bodies: new_plot=solution.AddTotalDeformation() temp_sel=ExtAPI.SelectionManager.CreateSelectionInfo(SelectionTypeEnum.GeometryEntities) temp_list=[body.Id] temp_sel.Ids=temp_list new_plot.Location=temp_sel solution.EvaluateAllResults() new_plot.ExportToSTLFile("D:\Test\test"+str(body.Id)+".stl")
12