I'm currently using the
LocateFeaturesAlongRoutes tool wrapper for C#/.NET for a custom tool I'm developing for ArcMap 9.3.1. I've been able to run this tool in ArcMap outside of code in a tool with the same files as parameters.
Unfortunately when I put it in code I keep getting null for the
IGeoProcessorResult. Is there any reason why I would get a null object for the result instead of just saying it failed? Also, is there anything wrong with the below code?
The relevant block of code is below.
LocateFeaturesAlongRoutes lfar = new LocateFeaturesAlongRoutes(); lfar.in_features = @"C:\GIS_Temp\CONGPROP.mdb\CONGPROP2"; lfar.in_routes = @"C:\GIS_Temp\Routes.mdb\routes"; lfar.route_id_field = "ROUTE_ID"; lfar.out_table = "eventTable.dbf"; lfar.out_event_properties = "ROUTE_ID LINE FMEAS TMEAS"; lfar.in_fields = "NO_FIELDS"; Geoprocessor geoprocessor = new Geoprocessor(); geoprocessor.TemporaryMapLayers = false; geoprocessor.OverwriteOutput = true; geoprocessor.AddOutputsToMap = true; IGeoProcessorResult result = (IGeoProcessorResult) geoprocessor.Execute(lfar, null);