TAGGED: animation, export, python-scripting, scripting
-
-
October 18, 2024 at 5:26 pm
sohanur.rahman
SubscriberHello,
I am trying to export animation of a specific result(e.g., Total Deformation) in Ansys Mechanical using a python script. I am getting the result animation for the whole range of timestep (e.g., 0 to 18 sec). However, I want to select the timestep range(e.g., 4 to 18 sec) for the exported animation in my script . Is there any way to do this in the python script? -
October 28, 2024 at 6:56 pm
Pedram Samadian
Ansys EmployeeHi,
Thanks for contacting us. The following Python script helps to export an animation from the evolution of Total Deformation throughout the simulation from a specific view (ISO in this case) with the specified frame numbers and video duration in Ansys Mechanical.
########################################################
cam = Graphics.Camera
cam.SetSpecificViewOrientation(ViewOrientationType.Iso)
Graphics.ResultAnimationOptions.NumberOfFrames = 100
Graphics.ResultAnimationOptions.Duration = Quantity(2, ‘s’)
totalDeform = DataModel.GetObjectsByName(“Total Deformation”)[0]
totalDeform.ExportAnimation(“C:\\Users\\pesamadi\\Downloads\\test\\test.mp4”,GraphicsAnimationExportFormat.MP4)######################################################
I will ask the developers about the required commands to specify the start and end times of the animation and then update my respond.
Thanks,
Pedram
-
- You must be logged in to reply to this topic.
-
2452
-
931
-
599
-
591
-
581
© 2025 Copyright ANSYS, Inc. All rights reserved.