With Pro 3.0 I am trying to implement the SelectLayerByLocation geoprocessing tool. I have objects/classes that I want to pass in to the tool. I've looked at the community samples and the ESRI forums and I must be missing something because this throws an exception
System.InvalidOperationException
HResult=0x80131509
Message=convert unsupported type
Source=ArcGIS.Desktop.GeoProcessing
object[] listOfParameter = { SelectedProximityLayer, "WITHIN_A_DISTANCE_GEODESIC", featOrigin, "100 NAUTICALMILES", "NEW_SELECTION", "NOT_INVERT" };
var parameters = Geoprocessing.MakeValueArray(listOfParameter); //exception here
var gpResult = await Geoprocessing.ExecuteToolAsync("SelectLayerByLocation_management", parameters);
With ArcMap you could call out a native .NET API to do this and I can't find anything similar with Pro:
Dim selLyrLoc As New SelectLayerByLocation
selLyrLoc.in_layer = pPointProxLayer 'the selection will be applied to this layer
selLyrLoc.overlap_type = "WITHIN_A_DISTANCE_GEODESIC" 'we want features within a geodesic distance
selLyrLoc.select_features = pFeatSelOrigin 'this is the source feature
selLyrLoc.search_distance = "100 NAUTICALMILES" 'search within 100 NM of the source
selLyrLoc.selection_type = "NEW_SELECTION" 'new selection
selLyrLoc.invert_spatial_relationship = "NOT_INVERT" 'do not invert selection
'run the geoprocessor
Dim res As ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult = CType(GP.Execute(selLyrLoc, Nothing), ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult)
I see that the parameter list is a string list but how do I feed my objects /classes to any geoprocessing tool?