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

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

    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: 82
    Name Dropper First Anniversary First Answer 25 Likes
    ✭✭✭✭
    Answer ✓

    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
    **

    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: 327
    25 Answers First Anniversary 100 Comments 25 Likes
    ✭✭✭✭

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