Export screenshot of result for each result in the tree
Pernelle Marone-Hitz
Member, Moderator, Employee Posts: 871
✭✭✭✭
Using ACT, how can I export a screenshot of each result inserted in the Mechanical tree?
Tagged:
0
Answers
-
The following code can be used :
import os setting2d = Ansys.Mechanical.Graphics.GraphicsImageExportSettings() setting2d.Resolution = GraphicsResolutionType.HighResolution setting2d.Width = 838 setting2d.Height = 392 setting2d.Background = GraphicsBackgroundType.White setting2d.CurrentGraphicsDisplay = False imagePath = "C:\Users\Test\" # change directory as needed solution = ExtAPI.DataModel.Project.Model.Analyses[0].Solution # reference solution results = solution.GetChildren(DataModelObjectCategory.Result,True) # get list of results in solution for result in results: result.Activate() totalPath = os.path.join(imagePath) + result.Name+'.png' ExtAPI.Graphics.ExportImage(totalPath, GraphicsImageExportFormat.PNG, setting2d)
2