ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / TinLayer Class
Members Example

In This Topic
    TinLayer Class
    In This Topic
    Represents a TIN layer.
    Object Model
    TinLayer ClassCIMTinRenderer ClassCIMDataConnection ClassTimeExtent ClassCIMBaseLayer ClassLineOfSightResult ClassSpatialReference ClassTimeParameters ClassTinDataset ClassMap ClassILayerContainer InterfaceEnvelope ClassTinEdgeCursor ClassTinNodeCursor ClassTinTriangleCursor Class
    Syntax
    Example
    Retrieve layers
    // find the first TIN layer
    var tinLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<TinLayer>().FirstOrDefault();
    
    // find the first Terrain layer
    var terrainLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<TerrainLayer>().FirstOrDefault();
    
    // find the first LAS dataset layer
    var lasDatasetLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<LasDatasetLayer>().FirstOrDefault();
    
    // find the set of surface layers
    var surfacelayers = MapView.Active.Map.GetLayersAsFlattenedList().OfType<SurfaceLayer>();
    Create a TinLayer
    //Must be on the QueuedTask.Run()
    
    string tinPath = @"d:\Data\Tin\TinDataset";
    var tinURI = new Uri(tinPath);
    
    var tinCP = new TinLayerCreationParams(tinURI);
    tinCP.Name = "My TIN Layer";
    tinCP.IsVisible = false;
    
    //Create the layer to the TIN
    var tinLayer = LayerFactory.Instance.CreateLayer<TinLayer>(tinCP, map);
    Create a TinLayer from a dataset
    //Must be on the QueuedTask.Run()
    
    var tinCP_ds = new TinLayerCreationParams(tinDataset);
    tinCP_ds.Name = "My TIN Layer";
    tinCP_ds.IsVisible = false;
    
    //Create the layer to the TIN
    
    var tinLayer_ds = LayerFactory.Instance.CreateLayer<TinLayer>(tinCP_ds, map);
    Create a TinLayer with renderers
    //Must be on the QueuedTask.Run()
    
    var tinCP_renderers = new TinLayerCreationParams(tinDataset);
    tinCP_renderers.Name = "My TIN layer";
    tinCP_renderers.IsVisible = true;
    
    // define the node renderer - use defaults
    var node_rd = new TinNodeRendererDefinition();
    
    // define the face/surface renderer
    var face_rd = new TinFaceClassBreaksRendererDefinition();
    face_rd.ClassificationMethod = ClassificationMethod.NaturalBreaks;
    // accept default color ramp, breakCount
    
    // set up the renderer dictionary
    var rendererDict = new Dictionary<SurfaceRendererTarget, TinRendererDefinition>();
    rendererDict.Add(SurfaceRendererTarget.Points, node_rd);
    rendererDict.Add(SurfaceRendererTarget.Surface, face_rd);
    
    // assign the dictionary to the creation params
    tinCP_renderers.RendererDefinitions = rendererDict;
    
    // create the layer
    var tinLayer_rd = LayerFactory.Instance.CreateLayer<TinLayer>(tinCP_renderers, MapView.Active.Map);
    Simple Node Renderer
    // applies to TIN layers only
    
    var nodeRendererDef = new TinNodeRendererDefinition();
    nodeRendererDef.Description = "Nodes";
    nodeRendererDef.Label = "Nodes";
    nodeRendererDef.SymbolTemplate = nodeSymbol.MakeSymbolReference();
    
    var tinLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<TinLayer>().FirstOrDefault();
    if (tinLayer == null)
      return;
    
    if (tinLayer.CanCreateRenderer(nodeRendererDef))
    {
      CIMTinRenderer renderer = tinLayer.CreateRenderer(nodeRendererDef);
      if (tinLayer.CanSetRenderer(renderer, SurfaceRendererTarget.Points))
        tinLayer.SetRenderer(renderer, SurfaceRendererTarget.Points);
    }
    Inheritance Hierarchy

    System.Object
       ArcGIS.Desktop.Framework.Contracts.PropertyChangedBase
          ArcGIS.Desktop.Mapping.MapMember
             ArcGIS.Desktop.Mapping.Layer
                ArcGIS.Desktop.Mapping.SurfaceLayer
                   ArcGIS.Desktop.Mapping.TinLayer

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.2 or higher.
    See Also