Export Result Images to Files

Goal: Export all results in the tree to PNG (2D image) and AVZ (3D image) files.

Code:

# get a list of all the results in the project
results = DataModel.GetObjectsByType(DataModelObjectCategory.Result)

#loop over the results
for result in results:
	
    # select and activate the result                      
    result.Activate()
	
    # export the result to avz file using the result name for the filename
    avzFilename = "D:\\Images\\" + result.Name + ".avz"
    Graphics.Export3D(avzFileName)

    # export the result as a 2D PNG file
    Graphics.ExportImage("D:\\images\\" + result.Name + ".png")

print "Done with Exporting Results"