How can I show/hide Mesh on a contour result?
Setting edgeDisplay to 3 will show the Mesh, to hide it set it to any other value:
edgeDisplay
3
graphics = ExtAPI.DataModel.InternalObject["ds"].Graphics graphics.ResultPrefs.edgeDisplay = 3 graphics.Refresh()
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()
This is not working anymore in version 2023 R2.
Can you please share the new code with sma functionality? Thanks
Prefs = ExtAPI.Graphics.ViewOptions.ResultPreference Prefs.ShowMaximum=False Prefs.ShowMinimum=False Prefs.ExtraModelDisplay=MechanicalEnums.Graphics.ExtraModelDisplay.NoWireframe