Get a utility network element from a selected feature

1485
10
12-27-2018 05:58 PM
EdwardBlair
Occasional Contributor

Am assuming (but don't really know) that there is an equivalent in ArcGIS Pro/Utility Network to the Geometric Network for getting network elements from a selected feature.  There don't seem to be classes like ISimpleEdgeFeature or ISimpleJunctionFeature that subclass Feature.   And there doesn't seem to be anything like a GetNetworkElement() member on the Feature class.  But I suspect there is *some* way to do this.  If someone could point me in a direction here, that would be much appreciated.

Thx,

Ed

10 Replies
EdwardBlair
Occasional Contributor

Please note, I'm aware of the documentation that describes fetching features from an element -- and that describes many other cool utility network functions as well.  What I can't seem to find is the process to go in the other direction -- that is, get network element(s) from a given feature.

Thx,

Ed

0 Kudos
CharlesMacleod
Esri Regular Contributor

Ed, I think this is what you are after:

UtilityNetwork.CreateElement

so, it might look something like this:

 var layer = map.GetLayersAsFlattenedList().OfType<UtilityNetworkLayer>().FirstOrDefault();
 if (layer != null)
 {
    var utilityNetwork = layer.GetUtilityNetwork();
    //the feature class being a network source...
    var rowCursor = featureClass.Search(queryFilter);
    while (rowCursor.MoveNext())
    {
       var currentRow = rowCursor.Current;
       var currentElement = utilityNetwork.CreateElement(currentRow);
EdwardBlair
Occasional Contributor

Looks good. Thanks Charlie!

0 Kudos
RichRuh
Esri Regular Contributor

Charlie's code will get you the ArcGIS.Core.Data.UtilityNetwork.Element object that corresponds to a feature.  This is used for editing associations, setting starting points and barriers, and getting results back from a trace.  It does *not* give you access to the fine-grained topology for that feature.  For example, if a linear feature representing a conductor consists of five edges with taps between them, you cannot get back the five individual edges.  This capability is not yet exposed through the utility network. 

RichardDumont
New Contributor II

Rich, Any ETA on this?

0 Kudos
RichRuh
Esri Regular Contributor

None.  

Our intent is that network topology operations should take place server-side using our tracing framework.  If you have scenarios or use cases that tracing doesn't currently fulfill, we would love to hear details.

Exporting topology information for a subnetwork (circuit) for the purposes of exporting to a third-party OMS, DMS, or analysis package will be supported at ArcGIS Enterprise 10.7.

Hope this helps,

--Rich

RichardDumont
New Contributor II

Rich,

   The export of the topology was something I was thinking about, OMS/DMS (CIM) specifically, I heard about the export and I am hoping this will do what I am thinking.  I will check out 10.7 when it is available and I have the time.  (Billable time does come first.)  Thanks again!

Rich

0 Kudos
StarletMyers
New Contributor

Rich,

Is this "export topology" now in 10.7?  What function should I look for in the API?

Thanks

Star

0 Kudos
RichRuh
Esri Regular Contributor

Hi Star,

Yes, this is included with the Export Subnetwork geoprocessing tool.  You can call it from a geoprocessing model, Python, or by using the geoprocessing API in the Pro SDK.

--Rich

0 Kudos