Using ACT, how can I loop through each bodies of the model, insert a total deformation result for th
Pernelle Marone-Hitz
Member, Moderator, Employee Posts: 867
✭✭✭✭
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