I am looking for a way to programmatically create a route event layer from a feature layer and a standalone table added to a map in Pro. The geoprocessing code below executes without errors but the event layer does not get added to the map. If I use the out-of-the-box "Make Route Event Layer" GP tool, the event layer is created as expected.
List<object> argsMakeLayer = new List<object> { streetLayer.Name, "LINK_ID", eventTable.Name, "Link_ID; LINE; FromMeasure; ToMeasure", "Route_Event_Layer", "MapOffset", "NO_ERROR_FIELD", "NO_ANGLE_FIELD", "NORMAL", "ANGLE", "LEFT", "POINT" };
IGPResult result = await Geoprocessing.ExecuteToolAsync("lr.MakeRouteEventLayer", Geoprocessing.MakeValueArray(argsMakeLayer.ToArray()), null, null, null, GPExecuteToolFlags.None);
Is it possible to make this work using the GP approach above? Alternatively, is there a way to create the event layer without using geoprocessing?
I am using Pro 2.9. Thanks!
Solved! Go to Solution.
Hi,
Try to change GPExecuteToolFlags.None to GPExecuteToolFlags.AddOutputsToMap in Geoprocessing.ExecuteToolAsync.
https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic9375.html
Hi,
Try to change GPExecuteToolFlags.None to GPExecuteToolFlags.AddOutputsToMap in Geoprocessing.ExecuteToolAsync.
https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic9375.html
Thanks for the help, that was the problem!