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

Options
Ayush Kumar
Ayush Kumar Member, Moderator, Employee Posts: 419
5 Likes First Anniversary Ansys Employee Solution Developer Community of Practice Member
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: 419
    5 Likes First Anniversary Ansys Employee Solution Developer Community of Practice Member
    Answer ✓
    Options

    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)