ArcObjects Library Reference

Set Globe Layer Properties Snippet

Set the globe layer properties.

[C#]

///<summary>Set the globe layer properties.</summary>
/// 
///<param name="globeDisplay">An IGlobeDiaply interface</param>
///<param name="layer">An ILayer interface</param>
///  
///<remarks></remarks>
public void SetGlobeLayerProperties1(ESRI.ArcGIS.GlobeCore.IGlobeDisplay globeDisplay, ESRI.ArcGIS.Carto.ILayer layer)
{
  ESRI.ArcGIS.GlobeCore.IGlobeDisplayLayers globeDisplayLayers = globeDisplay as ESRI.ArcGIS.GlobeCore.IGlobeDisplayLayers; // Reference or Boxing Conversion

  // Get IGlobeLayerProperties
  ESRI.ArcGIS.GlobeCore.IGlobeLayerProperties globeLayerProps = globeDisplayLayers.FindGlobeProperties(layer);

  // Get or Set the layer's properties
  globeLayerProps.Use16ColorBits = true;

  // Refresh the layer
  globeDisplayLayers.RefreshLayer(layer);
}
[Visual Basic .NET]

'''<summary>Set the globe layer properties.</summary>
''' 
'''<param name="globeDisplay">An IGlobeDiaply interface</param>
'''<param name="layer">An ILayer interface</param>
'''  
'''<remarks></remarks>
Public Sub SetGlobeLayerProperties(ByVal globeDisplay As ESRI.ArcGIS.GlobeCore.IGlobeDisplay, ByVal layer As ESRI.ArcGIS.Carto.ILayer)

  Dim globeDisplayLayers As ESRI.ArcGIS.GlobeCore.IGlobeDisplayLayers = CType(globeDisplay, ESRI.ArcGIS.GlobeCore.IGlobeDisplayLayers) ' Explicit Cast

  ' Get IGlobeLayerProperties
  Dim globeLayerProps As ESRI.ArcGIS.GlobeCore.IGlobeLayerProperties = globeDisplayLayers.FindGlobeProperties(layer)

  ' Get or Set the layer's properties
  globeLayerProps.Use16ColorBits = True

  ' Refresh the layer
  globeDisplayLayers.RefreshLayer(layer)

End Sub


Additional Requirements
  • The code in this document requires the following References added to the Visual Studio project:
  • ESRI.ArcGIS.3DAnalyst
  • ESRI.ArcGIS.Carto
  • ESRI.ArcGIS.GlobeCore