ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / PointCloudFilterDefinition Class / FromCIM Method
The input collection of CIMPointCloudFilters
Example

In This Topic
    FromCIM Method
    In This Topic
    Creates a PointCloudFilterDefinition based on a collection of ArcGIS.Core.CIM.CIMPointCloudFilter.
    Syntax

    Parameters

    filters
    The input collection of CIMPointCloudFilters

    Return Value

    Example
    Update the ClassFlags for PointCloudSceneLayer
    {
      // Note: call within QueuedTask.Run()
      {
        var filters = pointCloudSceneLayer.GetFilters();
        PointCloudFilterDefinition fdef = null;
        if (filters.Count() == 0)
        {
          fdef = new PointCloudFilterDefinition()
          {
            //7 is "edge of flight line" - exclude
            ClassFlags = new List<ClassFlag> {
             new ClassFlag(7, ClassFlagOption.Exclude) }
          };
        }
        else
        {
          fdef = PointCloudFilterDefinition.FromCIM(filters);
          //keep any include or ignore class flags
          var keep = fdef.ClassFlags.Where(
                 cf => cf.ClassFlagOption != ClassFlagOption.Exclude).ToList();
          //7 is "edge of flight line" - exclude
          keep.Add(new ClassFlag(7, ClassFlagOption.Exclude));
          fdef.ClassFlags = keep;
        }
        //apply
        pointCloudSceneLayer.SetFilters(fdef.ToCIM());
      }
    }
    Get the filters for PointCloudSceneLayer
    {
      // Note: call within QueuedTask.Run()
      {
        IReadOnlyList<CIMPointCloudFilter> updatedFilter = pointCloudSceneLayer.GetFilters();
        foreach (var f in updatedFilter)
        {
          //There is either 0 or 1 of each
          if (f is CIMPointCloudReturnFilter returnFilter)
          {
            PointCloudFilterDefinition pcfl = PointCloudFilterDefinition.FromCIM(updatedFilter);
            List<PointCloudReturnType> updatedReturnValues = pcfl.ReturnValues;
    
          }
          if (f is CIMPointCloudValueFilter classCodesFilter)
          {
            // do something
          }
    
          if (f is CIMPointCloudBitFieldFilter classFlagsFilter)
          {
            // do something
          }
        }
      }
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also