Implementing IRouteMeasureCreator2.CreateUsingPoints method

Discussion created by snaperski on May 14, 2013
Latest reply on May 15, 2013 by snaperski

I'm facing a problem here when trying to mimic IRouteMeasureCreator2 interface functionality to create routes using calibration points.
What I'm trying to do here is that I am basically trying to replicate that functionality available at "Route editing" toolbar ("Make route" tool), where I can create a route on object level (geoprocessing tool "Creat routes" operates on layer level and is hence not suitable for me) by selecting the starting point of that route. This is crucial - I want my tool to select starting point programmatically from another point layer and further use points from in-memory workspace as calibration points.

In that temporary point featureclass created via InMemoryWorkspaceFactory I have two calibration points for one route - startpoint and endpoint. And I have successfully written attribute values which will hold needed M-values for creating a route.

Now, if calling
pRouteCreator.CreateUsingPoints(pSelSet, "TEE2", "MEASURELENGTH", 1, True, 0.5, False, pFeatClassName, geomdef, "", Nothing)

I get "The parameter is incorrect" (E_INVALIDARG) error.
I haven't found out where I went wrong... and also ESRI documentation is laconic about those parameters. Couldn't find any examples using .CreateUsingPoints aswell.

So one or two hints would probably guide me out:
1) Any working example implementing IRouteMeasureCreator2.CreateUsingPoints method
2) Any helping comment on the subject whether it is possible to create route from selected features using calibration points at all (via ArcObjects).   

My platform is ArcGIS 10.1 and VB.NET.

Thank you.
Raivo Alla,
Estonian Land Board