Export All Result Animations

Goal: Export the animation of the results in the model to a WMV video file with given resolution, frames and duration.

Code:

#Set camera and view
cam = Graphics.Camera
cam.SetSpecificViewOrientation(ViewOrientationType.Right)

#Animation settings
Graphics.ResultAnimationOptions.NumberOfFrames = 10
Graphics.ResultAnimationOptions.Duration = Quantity(2, 's')
settings = Ansys.Mechanical.Graphics.AnimationExportSettings(width = 1000, height = 665)

for analysis in Model.Analyses:
	results = analysis.Solution.GetChildren(DataModelObjectCategory.Result, True)
	for result in results:
		location ="C:\\Samples\\WMV\\" + result.Name + ".wmv"
		result.ExportAnimation(location, GraphicsAnimationExportFormat.WMV, settings)