While tracing, I Also want to visualize the network edges after each trace.
So I created a feature class of feature type Complex Edge (I have tried all esriSimple, esriSimpleEdge and esriSimpleComplex)
IFeatureClass edgesWithOrientation_FeatureClass = featureWorkspace.CreateFeatureClass("edgesWithOrientation", fields, CLSID, null, esriFeatureType.esriFTSimple, strShapeField, null);
While tracing, I get the geometry of each edge and add it into the above created feature class
IGeometry netEdgeFeat = _geomNet.get_GeometryForEdgeEID(connectedEdgeEID); IFeature edgeOrientationFeature = edgesWithOrientation_FeatureClass.CreateFeature(); edgeOrientationFeature.Shape = (IGeometry)netEdgeFeat; //ERROR edgeOrientationFeature.set_Value(edgesWithOrientation_FeatureClass.FindField("weight"), orientVal); edgeOrientationFeature.Store();
On the line
edgeOrientationFeature.Shape = (IGeometry)netEdgeFeat, An Exception is thrown: No support for this geometry type.
I'm not sure what geometry type is returned by
I've also tried to first cast the returned edge geometry into Polyline.
IPolyline netEdgePolyline = netEdgeFeat as IPolyline
The cast is successful but I get the same exception.