How do I export the Mechanical Graphics window image in a desired image format?

Ayush Kumar
Ayush Kumar Member, Moderator, Employee Posts: 389
First Anniversary Ansys Employee Solution Developer Community of Practice Member First Answer
edited June 2023 in Structures

How do I export the Mechanical Graphics window image in a desired image format?

Tagged:

Answers

  • Ayush Kumar
    Ayush Kumar Member, Moderator, Employee Posts: 389
    First Anniversary Ansys Employee Solution Developer Community of Practice Member First Answer
    Answer ✓

    Using ExtAPI.Graphics.ExportImage(filepath, image_format, image_settings)

    Example:

    image_settings = Ansys.Mechanical.Graphics.GraphicsImageExportSettings()
    image_settings.Background = GraphicsBackgroundType.White
    image_settings.Resolution = GraphicsResolutionType.HighResolution
    image_settings.FontMagnification = 1.3
    image_settings.Width = 600
    image_settings.Height = 500
    image_settings.CurrentGraphicsDisplay = False
    
    ExtAPI.Graphics.ExportImage(r"\Path\to\my\test_image.bmp", GraphicsImageExportFormat.BMP, image_settings)