ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Core.Data.Analyst3D Namespace / LasPointCursor Class / Current Property
Example

In This Topic
    Current Property (LasPointCursor)
    In This Topic
    Gets the current LasPoint in this LasPointCursor.
    Syntax
    public LasPoint Current {get;}
    Public ReadOnly Property Current As LasPoint
    Remarks
    If the cursor has passed the end of the collection (i.e., when MoveNext returns false), null is returned. If a valid LasPoint is returned by this property, it should be properly disposed through a call to System.IDisposable.Dispose or with the use of a using statement.
    Example
    Search LAS Points
    // search all points
    using (ArcGIS.Core.Data.Analyst3D.LasPointCursor ptCursor = lasDataset.SearchPoints(null))
    {
      while (ptCursor.MoveNext())
      {
        using (ArcGIS.Core.Data.Analyst3D.LasPoint point = ptCursor.Current)
        {
    
        }
      }
    }
    
    // search within an extent
    ArcGIS.Core.Data.Analyst3D.LasPointFilter pointFilter = new ArcGIS.Core.Data.Analyst3D.LasPointFilter();
    pointFilter.FilterGeometry = envelope;
    using (ArcGIS.Core.Data.Analyst3D.LasPointCursor ptCursor = lasDataset.SearchPoints(pointFilter))
    {
      while (ptCursor.MoveNext())
      {
        using (ArcGIS.Core.Data.Analyst3D.LasPoint point = ptCursor.Current)
        {
    
        }
      }
    }
    
    // search within an extent and limited to specific classification codes
    pointFilter = new ArcGIS.Core.Data.Analyst3D.LasPointFilter();
    pointFilter.FilterGeometry = envelope;
    pointFilter.ClassCodes = new List<int> { 4, 5 };
    using (ArcGIS.Core.Data.Analyst3D.LasPointCursor ptCursor = lasDataset.SearchPoints(pointFilter))
    {
      while (ptCursor.MoveNext())
      {
        using (ArcGIS.Core.Data.Analyst3D.LasPoint point = ptCursor.Current)
        {
    
        }
      }
    }
    
    Search for LAS Points
    // searching on the LasDatasetLayer will honor any LasPointDisplayFilter
    
    // search all points
    using (ArcGIS.Core.Data.Analyst3D.LasPointCursor ptCursor = lasDatasetLayer.SearchPoints(null))
    {
      while (ptCursor.MoveNext())
      {
        using (ArcGIS.Core.Data.Analyst3D.LasPoint point = ptCursor.Current)
        {
    
        }
      }
    }
    
    // search within an extent
    ArcGIS.Core.Data.Analyst3D.LasPointFilter pointFilter = new ArcGIS.Core.Data.Analyst3D.LasPointFilter();
    pointFilter.FilterGeometry = envelope;
    using (ArcGIS.Core.Data.Analyst3D.LasPointCursor ptCursor = lasDatasetLayer.SearchPoints(pointFilter))
    {
      while (ptCursor.MoveNext())
      {
        using (ArcGIS.Core.Data.Analyst3D.LasPoint point = ptCursor.Current)
        {
    
        }
      }
    }
    
    // search within an extent and limited to specific classification codes
    pointFilter = new ArcGIS.Core.Data.Analyst3D.LasPointFilter();
    pointFilter.FilterGeometry = envelope;
    pointFilter.ClassCodes = new List<int> { 4, 5 };
    using (ArcGIS.Core.Data.Analyst3D.LasPointCursor ptCursor = lasDatasetLayer.SearchPoints(pointFilter))
    {
      while (ptCursor.MoveNext())
      {
        using (ArcGIS.Core.Data.Analyst3D.LasPoint point = ptCursor.Current)
        {
    
        }
      }
    }
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.2 or higher.
    See Also