I am trying to learn how to use a Geometric Network at the same time as how to programmatically do a specific task. What I want is to select a single segment (by an attribute) and have it select all of the junctions of a particular featureclass (so I can get an attribute from each of the junctions). I got as far as set up my IGeometricNetwork object but I need to back up have someone tell me the basic steps I should take to accomplish what I want (assuming that it can be done). What type of trace task would this be and can I do a trace on a selected segment?
I guess it wasn't that hard, just intimidating at first. Hope it's accurate.
1. Get the FeatureCursor of all segments based on an attribute 2. For each Feature, cast it to an EdgeFeature 3. Get the FromToJunctionEIDs 4. Get the GeometricNetworkByName from the NetworkCollection (FeatureDataset) 5. Get the Logical Network and then the NetElements 6. Query the NetElements based on the EID and ElementType (ETJunction) to get the FeatureClassID, ObjectID and SubID 7. Check the FeatureClassID to make sure its the FeatureClass you want 8. Query it based on the ObjectID to get the desired attribute