ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.Data.Analyst3D Namespace / LasPointCursor Class / MoveNext Method
Example

In This Topic
    MoveNext Method (LasPointCursor)
    In This Topic
    Advances to the next LasPoint in this LasPointCursor. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Function MoveNext() As Boolean
    public bool MoveNext()

    Return Value

    true if the cursor has successfully advanced to the next point; false if the cursor has passed the end of the collection.
    Exceptions
    ExceptionDescription
    This instance has already called MoveNextArray. Call Reset before using this method.
    A geodatabase-related exception has occurred.
    Remarks
    If MoveNext() returns true, a LasPoint object is created. Even if this point (Current) is not otherwise needed, 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 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
    {
      // Note: Needs QueuedTask to run
      {
        // 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;
            //Use the point
          }
        }
    
        // 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;
            //Use the point
          }
        }
    
        // 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;
            //Use the point
          }
        }
      }
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.2 or higher.
    See Also