ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / FeatureSceneLayer Class / IsEditable Property
Example

In This Topic
    IsEditable Property (FeatureSceneLayer)
    In This Topic
    Gets whether the feature scene layer is editable.
    Syntax
    public bool IsEditable {get;}
    Public ReadOnly Property IsEditable As Boolean
    Example
    Determine if a FeatureSceneLayer supports editing
    var featSceneLayer = MapView.Active.Map.GetLayersAsFlattenedList()
                       .OfType<FeatureSceneLayer>().FirstOrDefault();
    if (!featSceneLayer.HasAssociatedFeatureService || 
        !featSceneLayer.IsEditable)
      return;//not supported
    
    //TODO continue editing here...
    
    Create a new Point feature in FeatureSceneLayer
    //must support editing!
    //var featSceneLayer = ... ;
    if (!featSceneLayer.HasAssociatedFeatureService || 
        !featSceneLayer.IsEditable)
      return;
    //Check geometry type...must be point in this example
    if (featSceneLayer.ShapeType != esriGeometryType.esriGeometryPoint)
      return;
    
    var editOp = new EditOperation()
    {
      Name = "Create new 3d point feature",
      SelectNewFeatures = true
    };
    
    var attributes = new Dictionary<string, object>();
    //mapPoint contains the new 3d point location
    attributes.Add("SHAPE", mapPoint);
    attributes.Add("TreeID", "1");
    editOp.Create(featSceneLayer, attributes);
    editOp.ExecuteAsync();//fyi, no await
    
    Delete all the selected features in FeatureSceneLayer
    //must support editing!
    //var featSceneLayer = .... ;
    if (!featSceneLayer.HasAssociatedFeatureService || 
        !featSceneLayer.IsEditable)
      return;
    
    var delOp = new EditOperation()
    {
      Name = "Delete selected features"
    };
    //Assuming we have a selection on the layer...
    delOp.Delete(featSceneLayer, featSceneLayer.GetSelection().GetObjectIDs());
    await delOp.ExecuteAsync();//await if needed but not required
    
    Edit the attributes of a FeatureSceneLayer
    //must support editing!
    var featSceneLayer = MapView.Active.Map.GetLayersAsFlattenedList()
                       .OfType<FeatureSceneLayer>().FirstOrDefault();
    if (!featSceneLayer.HasAssociatedFeatureService || 
        !featSceneLayer.IsEditable)
      return;
    
    var ok = await QueuedTask.Run(() =>
    {
      var editOp = new EditOperation()
      {
        Name = "Edit FeatureSceneLayer Attributes",
        SelectModifiedFeatures = true
      };
      //make an inspector
      var inspector = new Inspector();
      //get the attributes for the specified oid
      inspector.Load(featSceneLayer, oid);
      inspector["PermitNotes"] = "test";//modify
      editOp.Modify(inspector);
      return editOp.Execute();//synchronous flavor
    });
    
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also