ArcGIS Pro 3.5 API Reference Guide
ArcGIS.Core.Data.Analyst3D Namespace / TinEditor Class / AddFromFeatureClass Method
The feature class that provides the input geometries from which to create the TIN.
The filter that may be used to select a subset of features. This can be null. If it is null, then all the geometries in the feature class are used.
A field in the feature class that indicates where the heights for the shapes come from. If the shape geometry is 3D, and that's what you want to use, pass the shape field. Otherwise, a numeric field can be used. If the heights for the features should be interpolated from the existing state of the TIN, assuming some features with heights had been previously added, you can pass null to indicate the features do not have Z values of their own.
A numeric field in the feature class used to assign tags to corresponding elements in the TIN. Tag values are integers that are assigned to nodes, edges, or triangles. They have user defined meaning (e.g. node accuracy, land cover, etc.). If no tag values are to be used, then pass null.
A surface type indicating how the input feature geometry is incorporated into the triangulation.
Example

In This Topic
    AddFromFeatureClass Method
    In This Topic
    Adds features from a feature class to the TIN. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Sub AddFromFeatureClass( _
       ByVal featureClass As FeatureClass, _
       ByVal queryFilter As QueryFilter, _
       ByVal heightField As Field, _
       ByVal tagField As Field, _
       ByVal tinSurfaceType As TinSurfaceType _
    ) 

    Parameters

    featureClass
    The feature class that provides the input geometries from which to create the TIN.
    queryFilter
    The filter that may be used to select a subset of features. This can be null. If it is null, then all the geometries in the feature class are used.
    heightField
    A field in the feature class that indicates where the heights for the shapes come from. If the shape geometry is 3D, and that's what you want to use, pass the shape field. Otherwise, a numeric field can be used. If the heights for the features should be interpolated from the existing state of the TIN, assuming some features with heights had been previously added, you can pass null to indicate the features do not have Z values of their own.
    tagField
    A numeric field in the feature class used to assign tags to corresponding elements in the TIN. Tag values are integers that are assigned to nodes, edges, or triangles. They have user defined meaning (e.g. node accuracy, land cover, etc.). If no tag values are to be used, then pass null.
    tinSurfaceType
    A surface type indicating how the input feature geometry is incorporated into the triangulation.
    Exceptions
    ExceptionDescription
    This method must be called on the MCT. Use QueuedTask.Run.
    The input feature class is null.
    The editor is not in edit mode.
    One or more input features contain NULL Shape or field value.
    Remarks
    If records containing NULL shapes or numeric fields with NULL Z values are encountered, the triangulation process will skip them and continue. If this happens, a ArcGIS.Core.Data.Exceptions.TinException is thrown with the message "One or more input features contain NULL Shape or field value." when it's finished. Therefore, all valid data in the feature class gets triangulated but a note is made, in the form of a specific error, to let the you know one or more records were skipped. You then have the choice of using the resulting TIN or not.
    Example
    Add geometries from feature class
    var fields = featureClass.GetDefinition().GetFields();
    
    // Use the z-values from the geometries as the height field
    Field heightField = fields.First(f => f.FieldType == FieldType.Geometry);
    
    // Set the vertices from the geometries as TIN nodes
    tinEditor.AddFromFeatureClass(featureClass, null, heightField, null, TinSurfaceType.MassPoint);
    
    // Use the object ids as tag values
    Field tagField = fields.First(f => f.FieldType == FieldType.OID);
    
    // Set the lines from the geometries as TIN edges
    tinEditor.AddFromFeatureClass(featureClass, null, heightField, tagField, TinSurfaceType.HardLine);
    
    // Only use certain geometries in the TIN
    QueryFilter filter = new QueryFilter()
    {
      ObjectIDs = new List<long> { 2, 6, 7, 8, 9, 10, 14, 17, 21, 22 }
    };
    tinEditor.AddFromFeatureClass(featureClass, filter, heightField, tagField, TinSurfaceType.HardLine);
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.5 or higher.
    See Also