ArcGIS Pro 3.1 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / FeatureSceneLayer Class
Members Example

In This Topic
    FeatureSceneLayer Class
    In This Topic
    FeatureSceneLayers currently support the I3S Point and 3D Object layer types. Points must be based off 3D point data and 3D Objects must be based off multipatches.
    Object Model
    FeatureSceneLayer ClassDefinitionQuery ClassLayer ClassCIMDataConnection ClassTimeExtent ClassCIMBaseLayer ClassFeatureClass ClassCIMRenderer ClassSelection ClassSpatialReference ClassTimeParameters ClassMap ClassILayerContainer InterfaceEnvelope ClassRowCursor ClassSelection ClassDefinitionQuery Class
    Syntax
    Example
    Create a Scene Layer
    var sceneLayerUrl = @"https://myportal.com/server/rest/services/Hosted/SceneLayerServiceName/SceneServer";
    //portal items also ok as long as the portal is the current active portal...
    //var sceneLayerUrl = @"https://myportal.com/home/item.html?id=123456789abcdef1234567890abcdef0";
    
    await QueuedTask.Run(() =>
    {
      //Create with initial visibility set to false. Add to current scene
      var createparams = new LayerCreationParams(new Uri(sceneLayerUrl, UriKind.Absolute))
      {
        IsVisible = false
      };
    
      //cast to specific type of scene layer being created - in this case FeatureSceneLayer
      var sceneLayer = LayerFactory.Instance.CreateLayer<Layer>(
               createparams, MapView.Active.Map) as FeatureSceneLayer;
      //or...specify the cast directly
      var sceneLayer2 = LayerFactory.Instance.CreateLayer<FeatureSceneLayer>(
               createparams, MapView.Active.Map);
      //ditto for BuildingSceneLayer, PointCloudSceneLayer, IntegratedMeshSceneLayer
      //...
    });
          
    Name of FeatureSceneLayer
    var featSceneLayer = MapView.Active.Map.GetLayersAsFlattenedList()
                     .OfType<FeatureSceneLayer>().FirstOrDefault();
    var scenelayerName = featSceneLayer?.Name;
    
    Use MapView Selection SelectFeaturesEx or GetFeaturesEx
    //var featSceneLayer = ...;
    var sname = featSceneLayer.Name;
    
    await QueuedTask.Run(() =>
    {
      //Select all features within the current map view
      var sz = MapView.Active.GetViewSize();
    
      var c_ll = new Coordinate2D(0, 0);
      var c_ur = new Coordinate2D(sz.Width, sz.Height);
      //Use screen coordinates for 3D selection on MapView
      var env = EnvelopeBuilderEx.CreateEnvelope(c_ll, c_ur);
    
      //HasAssociatedFeatureService does not matter for SelectFeaturesEx
      //or GetFeaturesEx
      var result = MapView.Active.SelectFeaturesEx(env);
      //var result = MapView.Active.GetFeaturesEx(env);
    
      //The list of object ids from SelectFeaturesEx
      //At 2.x - var oids1 = result.Where(kvp => kvp.Key.Name == sname).First().Value;
      var oids1 = result.ToDictionary().Where(kvp => kvp.Key.Name == sname).First().Value;
      //TODO - use the object ids
    
      MapView.Active.Map.ClearSelection();
    });
    
    Inheritance Hierarchy

    System.Object
       ArcGIS.Desktop.Framework.Contracts.PropertyChangedBase
          ArcGIS.Desktop.Mapping.MapMember
             ArcGIS.Desktop.Mapping.Layer
                ArcGIS.Desktop.Mapping.CompositeLayer
                   ArcGIS.Desktop.Mapping.FeatureSceneLayer

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.0 or higher.
    See Also