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


IScene.AddLayer Method (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference (3DAnalyst)  

IScene.AddLayer Method

Adds a layer to the scene.

[Visual Basic .NET]
Public Sub AddLayer ( _
    ByVal pLayer As ILayer, _
    [ByVal autoArrange As Boolean] _
)
[C#]
public void AddLayer (
    ILayer pLayer,
    bool autoArrange
);
[C#]

Optional Values

autoArrange   Supply false as a default value.
[C++]
HRESULT AddLayer(
  ILayer* pLayer,
  VARIANT_BOOL autoArrange
);
[C++]

Parameters pLayer [in]
pLayer is a parameter of type ILayer autoArrange [in, optional, defaultvalue(VARIANT_FALSE)] autoArrange is a parameter of type VARIANT_BOOL

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires 3D Analyst Extension.

Remarks

The autoArrange parameter controls the ordering of the layers.  If autoArrange is set to TRUE, the layer is added in the proper position as by its weight specified via ILayerPosition::LayerWeight.  By default, this means that the layers are sorted by layer type - Annotation layers on top, followed by Point geometry layers, Polyline geometry layers, and at the bottom Polygon geometry layers.

See Also

IScene Interface

.NET Snippets

Add KML Data to Globe | Set Group Layer Cache | Add Graphics Layer to Globe

.NET Samples

Creating a toolbar of globe tools (Code Files: TableOfContents)