This document is archived and information here might be outdated.  Recommended version.


Add Vector Data to Globe Snippet (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference

Add Vector Data to Globe Snippet

Add Vector Data to Globe.

[C#]
///<summary>Add Vector Data to Globe</summary>
///      
///<param name="globe">An IGlobe interface</param>
///<param name="globeLayerType">An esriGlobeLayerType enum. Example: ESRI.ArcGIS.GlobeCore.esriGlobeLayerType.esriGlobeLayerTypeDraped</param>
///<param name="layer">An ILayer interface</param>
///      
///<remarks></remarks>
public void AddVectorDataToGlobe(ESRI.ArcGIS.GlobeCore.IGlobe globe, ESRI.ArcGIS.GlobeCore.esriGlobeLayerType globeLayerType, ESRI.ArcGIS.Carto.ILayer layer)
{
  if (globe == null || layer == null || globeLayerType == ESRI.ArcGIS.GlobeCore.esriGlobeLayerType.esriGlobeLayerTypeElevation || globeLayerType == ESRI.ArcGIS.GlobeCore.esriGlobeLayerType.esriGlobeLayerTypeUnknown)
  {
    return;
  }

  ESRI.ArcGIS.GlobeCore.IGlobeDisplay globeDisplay=globe.GlobeDisplay;
  ESRI.ArcGIS.GlobeCore.IGlobeDisplay2 globeDisplay2=globeDisplay as ESRI.ArcGIS.GlobeCore.IGlobeDisplay2; // Reference or Boxing Conversion
  globeDisplay2.PauseCaching=true;
  globe.AddLayerType(layer, globeLayerType, true);
  ESRI.ArcGIS.GlobeCore.IGlobeDisplayLayers globeDisplayLayers=globeDisplay as ESRI.ArcGIS.GlobeCore.IGlobeDisplayLayers; // Reference or Boxing Conversion
  ESRI.ArcGIS.GlobeCore.IGlobeLayerProperties globeLayerProperties=globeDisplayLayers.FindGlobeProperties(layer);
  globeLayerProperties.IsDynamicallyRasterized=false;
  globeDisplay2.PauseCaching=false;
}
[Visual Basic .NET]
'''<summary>Add Vector Data to Globe</summary>
'''      
'''<param name="globe">An IGlobe interface</param>
'''<param name="globeLayerType">An esriGlobeLayerType enum. Example: ESRI.ArcGIS.GlobeCore.esriGlobeLayerType.esriGlobeLayerTypeDraped</param>
'''<param name="layer">An ILayer interface</param>
'''      
'''<remarks></remarks>
Public Sub AddVectorDataToGlobe(ByVal globe As ESRI.ArcGIS.GlobeCore.IGlobe, ByVal globeLayerType As ESRI.ArcGIS.GlobeCore.esriGlobeLayerType, ByVal layer As ESRI.ArcGIS.Carto.ILayer)

  If globe Is Nothing OrElse layer Is Nothing OrElse globeLayerType=ESRI.ArcGIS.GlobeCore.esriGlobeLayerType.esriGlobeLayerTypeElevation OrElse globeLayerType=ESRI.ArcGIS.GlobeCore.esriGlobeLayerType.esriGlobeLayerTypeUnknown Then

   Return

  End If

  Dim globeDisplay As ESRI.ArcGIS.GlobeCore.IGlobeDisplay=globe.GlobeDisplay
  Dim globeDisplay2 As ESRI.ArcGIS.GlobeCore.IGlobeDisplay2=CType(globeDisplay, ESRI.ArcGIS.GlobeCore.IGlobeDisplay2) ' Explicit Cast
  globeDisplay2.PauseCaching=True
  globe.AddLayerType(layer, globeLayerType, True)
  Dim globeDisplayLayers As ESRI.ArcGIS.GlobeCore.IGlobeDisplayLayers=CType(globeDisplay, ESRI.ArcGIS.GlobeCore.IGlobeDisplayLayers) ' Explicit Cast
  Dim globeLayerProperties As ESRI.ArcGIS.GlobeCore.IGlobeLayerProperties=globeDisplayLayers.FindGlobeProperties(layer)
  globeLayerProperties.IsDynamicallyRasterized=False
  globeDisplay2.PauseCaching=False

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