Select to view content in your preferred language

Plot Geometry on a event Layer.

06-14-2021 03:58 AM
New Contributor III

Hi, In the below code plot Geometry on Event Layer with reference to a Route from Network Layer. The code is on Arc GIS desktop I want to convert it to plot the same on ArcGIS Pro. Can someone help me:

Dim factoryType As Type = Type.GetTypeFromProgID("esriDataSourcesGDB.SdeWorkspaceFactory")
Dim pWSF As IWorkspaceFactory = DirectCast(Activator.CreateInstance(factoryType), IWorkspaceFactory)
Dim pFWS As IFeatureWorkspace = TryCast(pWSF.OpenFromFile(layer.ConnectionPath, 0), IFeatureWorkspace)

Dim routeFC As IFeatureClass = pFWS.OpenFeatureClass(layer.Name)
Dim RouteLocator As IFeatureClass = pFWS.OpenFeatureClass(parentLayerName)

Dim ds As IDataset = DirectCast(RouteLocator, IDataset)
Dim name As IName = ds.FullName

Dim rtLocatorName As IRouteLocatorName = New RouteMeasureLocatorNameClass()
rtLocatorName.RouteFeatureClassName = name
rtLocatorName.RouteIDFieldName = routeIDFeldName
rtLocatorName.RouteMeasureUnit = esriUnits.esriFeet
name = DirectCast(rtLocatorName, IName)
Dim rtLocator As IRouteLocator2 = DirectCast(name.Open(), IRouteLocator2)
Dim routeLocation As IRouteLocation
If LayerType.Contains(LRS_LINEAREVENTLAYER) Then
routeLocation = New RouteMeasureLineLocationClass()
routeLocation = New RouteMeasurePointLocationClass()
End If
routeLocation.MeasureUnit = esriUnits.esriFeet
routeLocation.RouteID = routeID
routeLocation.LateralOffset = 0


ArcGIS Pro SDK 2.8  Net VB.

0 Kudos
1 Reply
New Contributor III

What can be used for IName in ArcGIS Pro.

Dim ds As IDataset = DirectCast(RouteLocator, IDataset)
Dim name As IName = ds.FullName

0 Kudos