-
-
February 28, 2023 at 1:37 pmpavankonchada123Subscriber
When I am trying to record the macro for saving Total Deformation and Stress as images using image to file option, I found that script is same for both cases. But how to differentiate between Deformation and stress for automation
image_settings = Ansys.Mechanical.Graphics.GraphicsImageExportSettings()
image_settings.CurrentGraphicsDisplay = False
image_settings.Resolution = GraphicsResolutionType.NormalResolution
image_settings.Capture = GraphicsCaptureType.ImageAndLegend
image_settings.Background = GraphicsBackgroundType.White
image_settings.FontMagnification = 1
Graphics.ExportImage(r"""D:\Projects\ES.png""", GraphicsImageExportFormat.PNG, image_settings) -
February 28, 2023 at 1:41 pmpavankonchada123Subscriber
I want to run this journal file to extract the images
result1 = system1.GetContainer(ComponentName="Results")
result1.Edit(Interactive=False)DSscript = open("D:scrt.py", "r")
DSscriptcommand=DSscript.read()
DSscript.close()
result1.SendCommand(Language='Python', Command = DSscriptcommand) -
February 28, 2023 at 2:57 pmpavankonchada123Subscriber
I have used as this as scrt.py but images are not coming
Â
'''NOTE : All workflows will not be recorded, as recording is under development.'''
solu=Model.Analyses[0].Solution
Graphics.Camera.FocalPoint = Point([0.000000, 0.050126, 0.000000], 'm')
Graphics.Camera.ViewVector = Vector3D(0.57735, 0.57735, 0.57735)
Graphics.Camera.UpVector = Vector3D(0, 1, 0)
Graphics.Camera.SceneHeight = Quantity(0.126253, 'm')
Graphics.Camera.SceneWidth = Quantity(0.046775, 'm')image_settings = Ansys.Mechanical.Graphics.GraphicsImageExportSettings()
image_settings.CurrentGraphicsDisplay = False
image_settings.Resolution = GraphicsResolutionType.NormalResolution
image_settings.Capture = GraphicsCaptureType.ImageAndLegend
image_settings.Background = GraphicsBackgroundType.White
image_settings.FontMagnification = 1totdef = solu.AddTotalDeformation()
totdef.EvaluateAllResults()Graphics.ExportImage(r"""D:\Projects\TD.png""", GraphicsImageExportFormat.PNG, image_settings)
equstress = solu.AddEquivalentStress()
equstress.EvaluateAllResults()
Graphics.ExportImage(r"""D:\Projects\ES.png""", GraphicsImageExportFormat.PNG, image_settings)
#endregionÂ
-
- The topic ‘Python Script to save Total deformation and Stress in a specific location (image’ is closed to new replies.
- At least one body has been found to have only 1 element in at least 2 directions
- Error when opening saved Workbench project
- How to apply Compression-only Support?
- Geometric stiffness matrix for solid elements
- Frictional No separation contact
- Image to file in Mechanical is bugged and does not show text
- Timestep range set for animation export
- Script Error Code:800a000d
- Elastic limit load, Elastic-plastic limit load
- Element has excessive thickness change, distortion, is turning inside out
-
1406
-
599
-
591
-
550
-
366
© 2025 Copyright ANSYS, Inc. All rights reserved.