Locate a route event

05-13-2020 02:29 PM
Occasional Contributor

I am attempting to obtain the geometry of a route event using the event properties. With ArcObjects VB.Net, this is the code that was used.

Dim routeLocation As IRouteLocation2=new RouteMeasureLineLocationClass()
//...Set other route properties here..//
Dim routeMeasureLineLocation As IRouteMeasureLineLocation=DirectCast(routeLocation,IRouteLocation2)
Dim geometry As IGeometry=Nothing
Dim routeLocator as IRouteLocator = Me.RouteLocator()

In converting the above code to Pro SDK C#, I was able to create an instance of the CIMRouteEventDataConnection class and set its properties as below:

var routeLocation = new CIMRouteEventDataConnection();
routeLocation.RouteIDFieldName = RouteFieldname;
routeLocation.RouteMeasureUnit = LinearUnit.Miles;
routeLocation.FromMeasureFieldName = fromMsField;
routeLocation.ToMeasureFieldName = ToMsField;

I, however, don't see a method for 'Locate' like in ArcObjects. So how do I actually generate the geometry that represents the line event?Uma HaranoWolfgang Kaiser

0 Kudos
5 Replies
by Esri Regular Contributor
Esri Regular Contributor

Hi Marvis,

 Currently the sole purpose of the CIMRouteEventDataConnection class is to expose some properties on a 'Route Event Layer'.  However, if you take a look at the comments in this 'idea post' this might be of help to you:


0 Kudos
New Contributor

Hello... I am also interested in learning about methods associated with CIMRouteEventDataConnection. We currently have an ArcMap AddIn written with original COM objects... then into VB.NET... now I am looking at building the same AddIn with ArcPro SDK .NET for use in ArcGIS PRO. Any new insights on how this may be done? maybe SDK .NET has not fully be built?  Our tool calculates a RiverMile distance from the mouth of a stream based on a Route being identified and then using associated feature Field Values of the layer being identified by the Route.  Thanks...

Tags (1)
0 Kudos
Occasional Contributor

Does anybody have an actual solution for this @RussBurman @MarvisKisakye1 ?

0 Kudos
Occasional Contributor

I saw that the topology api was released. I mean to look through it to see if it provides some solutions but I have not yet had the time. Check it out and see if it has what you need.

0 Kudos
Occasional Contributor

Well I actually figured this out today. I'm shocked honestly. I might be doing something slightly different than you guys, but I was simply trying to return the x,y of point along the route at a specific distance(measurement). 


 QueryFilter qF = new QueryFilter
    WhereClause = "RouteNumber = '504'"      
var featci = nLayer.GetSelection();
using (ArcGIS.Core.Data.RowCursor rCursor = featci.Search())
    while (rCursor.MoveNext())
       Feature gsFeature = rCursor.Current as Feature;
       var feat = gsFeature.GetShape();
       var efeat = feat.ToEsriShape();
       Polyline polyline = PolylineBuilder.FromEsriShape(efeat);
       double m1, m2;
       ArcGIS.Core.Geometry.Multipoint multipoint = GeometryEngine.Instance.GetPointsAtM(polyline, .4, 0);
       var mpc = multipoint.PointCount.ToString();


0 Kudos