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

Ayush Kumar
Ayush Kumar Member, Moderator, Employee Posts: 470
100 Answers 250 Likes 100 Comments Second 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: 470
    100 Answers 250 Likes 100 Comments Second 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: 86
    Second Anniversary 5 Answers 25 Likes 10 Comments
    ✭✭✭✭
    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: 367
    25 Answers 100 Comments Second Anniversary 25 Likes
    ✭✭✭✭

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