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<SPAN class="operator token">=</SPAN><SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">RouteMeasureLineLocationClass</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
routeLocation<SPAN class="punctuation token">.</SPAN>RouteID<SPAN class="operator token">=</SPAN>rteID
<SPAN class="comment token">//...Set other route properties here..//</SPAN>
Dim routeMeasureLineLocation As IRouteMeasureLineLocation<SPAN class="operator token">=</SPAN><SPAN class="token function">DirectCast</SPAN><SPAN class="punctuation token">(</SPAN>routeLocation<SPAN class="punctuation token">,</SPAN>IRouteLocation2<SPAN class="punctuation token">)</SPAN>
routeMeasureLineLocation<SPAN class="punctuation token">.</SPAN>FromMeasure<SPAN class="operator token">=</SPAN>fromMeasure
routeMeasureLineLocation<SPAN class="punctuation token">.</SPAN>ToMeasure<SPAN class="operator token">=</SPAN>toMeasure
Dim geometry As IGeometry<SPAN class="operator token">=</SPAN>Nothing
Dim routeLocator as IRouteLocator <SPAN class="operator token">=</SPAN> Me<SPAN class="punctuation token">.</SPAN><SPAN class="token function">RouteLocator</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
routeLocator<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Locate</SPAN><SPAN class="punctuation token">(</SPAN>routeLocation<SPAN class="punctuation token">,</SPAN>geometry<SPAN class="punctuation token">,</SPAN>locatingError<SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
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:
<SPAN class="keyword token">var</SPAN> routeLocation <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">CIMRouteEventDataConnection</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
routeLocation<SPAN class="punctuation token">.</SPAN>RouteIDFieldName <SPAN class="operator token">=</SPAN> RouteFieldname<SPAN class="punctuation token">;</SPAN>
routeLocation<SPAN class="punctuation token">.</SPAN>RouteMeasureUnit <SPAN class="operator token">=</SPAN> LinearUnit<SPAN class="punctuation token">.</SPAN>Miles<SPAN class="punctuation token">;</SPAN>
routeLocation<SPAN class="punctuation token">.</SPAN>FromMeasureFieldName <SPAN class="operator token">=</SPAN> fromMsField<SPAN class="punctuation token">;</SPAN>
routeLocation<SPAN class="punctuation token">.</SPAN>ToMeasureFieldName <SPAN class="operator token">=</SPAN> ToMsField<SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
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