How can I show/hide Mesh on a contour result?

Options
Ayush Kumar
Ayush Kumar Member, Moderator, Employee Posts: 411
First Anniversary Ansys Employee Solution Developer Community of Practice Member First Answer
edited December 2022 in General Language Questions

How can I show/hide Mesh on a contour result?

Tagged:

Best Answers

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

    Setting edgeDisplay to 3 will show the Mesh, to hide it set it to any other value:

    graphics = ExtAPI.DataModel.InternalObject["ds"].Graphics
    graphics.ResultPrefs.edgeDisplay = 3
    graphics.Refresh()
    
  • Javier Vique
    Javier Vique Member, Employee Posts: 74
    First Answer First Anniversary Name Dropper 5 Likes
    Answer ✓
    Options

    Function ExtAPI.DataModel.InternalObject["ds"].Graphics.ResultPrefs.edgeDisplay has several options which are worth to be commented. Please see below code:

    No wireframe: value 0

    Undeformed WireFrame: value 1

    Undeformed Model: value 2

    Show elements: value 3 (explained in the first answer)

    graphics = ExtAPI.DataModel.InternalObject["ds"].Graphics
    
    # No wireframe
    #graphics.ResultPrefs.edgeDisplay = 0
    #graphics.Refresh()
    
    # Undeformed wireframe
    # graphics.ResultPrefs.edgeDisplay = 1
    # graphics.Refresh()
    
    # Undefromed model
    # graphics.ResultPrefs.edgeDisplay = 2
    # graphics.Refresh()
    
    # Show elements
    # graphics.ResultPrefs.edgeDisplay = 3
    # graphics.Refresh()
    

Answers

  • aaazzzxxxx
    aaazzzxxxx Member Posts: 4
    First Comment
    Options

    This is not working anymore in version 2023 R2.

    Can you please share the new code with sma functionality? Thanks

  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 280
    First Anniversary First Comment 5 Likes Ansys Employee
    Options

    Prefs = ExtAPI.Graphics.ViewOptions.ResultPreference
    Prefs.ShowMaximum=False
    Prefs.ShowMinimum=False
    Prefs.ExtraModelDisplay=MechanicalEnums.Graphics.ExtraModelDisplay.NoWireframe