ArcGIS Pro 3.5 API Reference Guide
ArcGIS.Core.Data.Analyst3D Namespace / TinEditor Class / TinEditor Constructor / TinEditor Constructor(Envelope)
The intended 2-dimensional domain of the TIN. Data subsequently added to the TIN should fall within this extent. If the envelope has a spatial reference, it will be copied and assigned to the TIN.
Example

In This Topic
    TinEditor Constructor(Envelope)
    In This Topic
    Creates a new TIN editor instance. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public TinEditor( 
       Envelope extent
    )
    Public Function New( _
       ByVal extent As Envelope _
    )

    Parameters

    extent
    The intended 2-dimensional domain of the TIN. Data subsequently added to the TIN should fall within this extent. If the envelope has a spatial reference, it will be copied and assigned to the TIN.

    Return Value

    The newly created TIN editor in edit mode.
    Exceptions
    ExceptionDescription
    The envelope is null.
    The envelope is empty.
    This method must be called on the MCT. Use QueuedTask.Run.
    Remarks
    The newly created tin editor is in edit mode. Four software synthesized nodes (called super nodes) will be used to form an initial triangulation. These will be positioned outside the declared extent. You should be fairly accurate with the extent so the positions of the super nodes is estimated correctly. Providing an unnecessarily large extent would result in the nodes being placed farther away than necessary from the data which can hurt performance and increase the likelihood of precision related issues.
    Example
    Create TinEditor from envelope
    tinEditor = new TinEditor(envelope);
    bool isInEditMode = tinEditor.IsInEditMode;  // isInEditMode = true
    
    Create a new TIN and save edits
    // Create a new TIN 
    tinEditor = new TinEditor(envelope);
    tinEditor.AddMassPoints(points, 42, 13.7);
    
    // Since the TIN doesn't exist on disk, you can't call SaveEdits.
    // You must call SaveAs first.
    try
    {
      tinEditor.SaveEdits();
    }
    catch (TinException)
    {
      // Handle the exception
    }
    
    // Since the TIN doesn't exist on disk, you can't call StopEditing(true).
    // You must call SaveAs first.
    try
    {
      tinEditor.StopEditing(true);
    }
    catch (TinException)
    {
      // Handle the exception
    }
    
    // Now save the newly created TIN to disk
    tinEditor.SaveAs("C:\\Tin1", false);
    
    // Delete a node
    tinEditor.DeleteNode(7);
    
    // Since the TIN now exists on disk you can call SaveEdits
    tinEditor.SaveEdits();
    
    // Delete another node
    tinEditor.DeleteNode(11);
    
    // Since the TIN now exists on disk, you can call StopEditing(true).
    // The edits will be saved and the tin editor will be taken out of edit mode.
    tinEditor.StopEditing(true);
    bool isInEditMode = tinEditor.IsInEditMode; // isInEditMode = false
    
    // Now if you try to make an edit, an exception is thrown because the editor is not in edit mode.
    try
    {
      tinEditor.AddPointZ(pointZ, 0);
    }
    catch (TinException)
    {
      // Handle the exception
    }
    
    // Put the editor into edit mode.
    tinEditor.StartEditing();
    isInEditMode = tinEditor.IsInEditMode; // isInEditMode = true
    
    // Now you can add the point
    tinEditor.AddPointZ(pointZ, 0);
    
    // Oops, you didn't really want to add the point. You want to stop editing and discard the unsaved edits
    // since the last time the editor was put into edit mode. All previous saved edits remain.
    tinEditor.StopEditing(false);
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.5 or higher.
    See Also