<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: calculate the fnode tnode of a polyline shapefile in ArcGIS Network Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-network-analyst-questions/calculate-the-fnode-tnode-of-a-polyline-shapefile/m-p/731788#M7044</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks! the code works fine. My number of arcs in the dataset is like 5178, and the fromNode and toNode generated file has more arcs. I joined the two attribute table and selected only matched IDs to ignore the extra added arcs. Any comment?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;The network topology, that is, the from/to junctions for each edge is stored in the binary files of the network dataset. In general you do no need this information. May I ask what you intend to do with that information?&lt;BR /&gt;The way to get this information is to use ArcObjects to retrieve the values from the network dataset.&lt;BR /&gt;I am including a small VBA that you can run (if you have VBA installed) and it will write out the edge OID and the two from/to junction OIDs to a text file. Make sure the network dataset is added to ArcMap as the first layer when you run this VBA.&lt;BR /&gt;Jay Sandhu&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Public Sub List_ND_Topology_ToDisk()
&amp;nbsp; Dim pMxDoc As IMxDocument
&amp;nbsp; Set pMxDoc = ThisDocument
&amp;nbsp; 
&amp;nbsp; Dim pNLayer As INetworkLayer
&amp;nbsp; Set pNLayer = pMxDoc.FocusMap.Layer(0)
&amp;nbsp; 
&amp;nbsp; Dim pND As INetworkDataset
&amp;nbsp; Set pND = pNLayer.NetworkDataset
&amp;nbsp; 
&amp;nbsp; Dim pNQ As INetworkQuery
&amp;nbsp; Set pNQ = pND
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp; Dim pEnumNE As IEnumNetworkElement
&amp;nbsp; Set pEnumNE = pNQ.Elements(esriNETEdge)
&amp;nbsp; 
&amp;nbsp; Dim pFromJunction As INetworkJunction
&amp;nbsp; Set pFromJunction = pNQ.CreateNetworkElement(esriNETJunction)
&amp;nbsp; 
&amp;nbsp; Dim pToJunction As INetworkJunction
&amp;nbsp; Set pToJunction = pNQ.CreateNetworkElement(esriNETJunction)
&amp;nbsp; 
&amp;nbsp; Dim pNE As INetworkElement
&amp;nbsp; Set pNE = pEnumNE.Next
&amp;nbsp; 
&amp;nbsp; Dim pNEdge As INetworkEdge
&amp;nbsp; Set pNEdge = pNE
&amp;nbsp; Dim i As Integer
 Open "c:\temp\ND_FromTo.csv" For Output As #1 'set path as needed
 Print #1, """EdgeOID"", ""FromOID"", ""ToOID"", ""Lenght_Attribute"""
&amp;nbsp; Do Until pNE Is Nothing
&amp;nbsp;&amp;nbsp;&amp;nbsp; pNEdge.QueryJunctions pFromJunction, pToJunction
&amp;nbsp;&amp;nbsp;&amp;nbsp; Print #1, pNE.OID; ","; pFromJunction.OID; ","; pToJunction.OID; ","; pNE.AttributeValue(1)
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pNE = pEnumNE.Next
&amp;nbsp; Loop
&amp;nbsp;&amp;nbsp; Close #1
&amp;nbsp;&amp;nbsp; 
End Sub
&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 07:14:26 GMT</pubDate>
    <dc:creator>NaserHdieb</dc:creator>
    <dc:date>2021-12-12T07:14:26Z</dc:date>
    <item>
      <title>calculate the fnode tnode of a polyline shapefile</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/calculate-the-fnode-tnode-of-a-polyline-shapefile/m-p/731786#M7042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;how to calculate the fnode tnode of a polyline shapefile ? I tried network analyst but i could not create From Node to Node attribute in the line shapefile.... I have a node point shapefile and a line shapefile (center roads of alexandria VA) that I created from Network anaylyst. ...any help is appreciated&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Apr 2013 11:37:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/calculate-the-fnode-tnode-of-a-polyline-shapefile/m-p/731786#M7042</guid>
      <dc:creator>NaserHdieb</dc:creator>
      <dc:date>2013-04-17T11:37:25Z</dc:date>
    </item>
    <item>
      <title>Re: calculate the fnode tnode of a polyline shapefile</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/calculate-the-fnode-tnode-of-a-polyline-shapefile/m-p/731787#M7043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The network topology, that is, the from/to junctions for each edge is stored in the binary files of the network dataset. In general you do no need this information. May I ask what you intend to do with that information?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The way to get this information is to use ArcObjects to retrieve the values from the network dataset.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am including a small VBA that you can run (if you have VBA installed) and it will write out the edge OID and the two from/to junction OIDs to a text file. Make sure the network dataset is added to ArcMap as the first layer when you run this VBA.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jay Sandhu&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Public Sub List_ND_Topology_ToDisk()
&amp;nbsp; Dim pMxDoc As IMxDocument
&amp;nbsp; Set pMxDoc = ThisDocument
&amp;nbsp; 
&amp;nbsp; Dim pNLayer As INetworkLayer
&amp;nbsp; Set pNLayer = pMxDoc.FocusMap.Layer(0)
&amp;nbsp; 
&amp;nbsp; Dim pND As INetworkDataset
&amp;nbsp; Set pND = pNLayer.NetworkDataset
&amp;nbsp; 
&amp;nbsp; Dim pNQ As INetworkQuery
&amp;nbsp; Set pNQ = pND
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp; Dim pEnumNE As IEnumNetworkElement
&amp;nbsp; Set pEnumNE = pNQ.Elements(esriNETEdge)
&amp;nbsp; 
&amp;nbsp; Dim pFromJunction As INetworkJunction
&amp;nbsp; Set pFromJunction = pNQ.CreateNetworkElement(esriNETJunction)
&amp;nbsp; 
&amp;nbsp; Dim pToJunction As INetworkJunction
&amp;nbsp; Set pToJunction = pNQ.CreateNetworkElement(esriNETJunction)
&amp;nbsp; 
&amp;nbsp; Dim pNE As INetworkElement
&amp;nbsp; Set pNE = pEnumNE.Next
&amp;nbsp; 
&amp;nbsp; Dim pNEdge As INetworkEdge
&amp;nbsp; Set pNEdge = pNE
&amp;nbsp; Dim i As Integer
 Open "c:\temp\ND_FromTo.csv" For Output As #1 'set path as needed
 Print #1, """EdgeOID"", ""FromOID"", ""ToOID"", ""Lenght_Attribute"""
&amp;nbsp; Do Until pNE Is Nothing
&amp;nbsp;&amp;nbsp;&amp;nbsp; pNEdge.QueryJunctions pFromJunction, pToJunction
&amp;nbsp;&amp;nbsp;&amp;nbsp; Print #1, pNE.OID; ","; pFromJunction.OID; ","; pToJunction.OID; ","; pNE.AttributeValue(1)
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pNE = pEnumNE.Next
&amp;nbsp; Loop
&amp;nbsp;&amp;nbsp; Close #1
&amp;nbsp;&amp;nbsp; 
End Sub
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:14:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/calculate-the-fnode-tnode-of-a-polyline-shapefile/m-p/731787#M7043</guid>
      <dc:creator>JaySandhu</dc:creator>
      <dc:date>2021-12-12T07:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: calculate the fnode tnode of a polyline shapefile</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/calculate-the-fnode-tnode-of-a-polyline-shapefile/m-p/731788#M7044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks! the code works fine. My number of arcs in the dataset is like 5178, and the fromNode and toNode generated file has more arcs. I joined the two attribute table and selected only matched IDs to ignore the extra added arcs. Any comment?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;The network topology, that is, the from/to junctions for each edge is stored in the binary files of the network dataset. In general you do no need this information. May I ask what you intend to do with that information?&lt;BR /&gt;The way to get this information is to use ArcObjects to retrieve the values from the network dataset.&lt;BR /&gt;I am including a small VBA that you can run (if you have VBA installed) and it will write out the edge OID and the two from/to junction OIDs to a text file. Make sure the network dataset is added to ArcMap as the first layer when you run this VBA.&lt;BR /&gt;Jay Sandhu&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Public Sub List_ND_Topology_ToDisk()
&amp;nbsp; Dim pMxDoc As IMxDocument
&amp;nbsp; Set pMxDoc = ThisDocument
&amp;nbsp; 
&amp;nbsp; Dim pNLayer As INetworkLayer
&amp;nbsp; Set pNLayer = pMxDoc.FocusMap.Layer(0)
&amp;nbsp; 
&amp;nbsp; Dim pND As INetworkDataset
&amp;nbsp; Set pND = pNLayer.NetworkDataset
&amp;nbsp; 
&amp;nbsp; Dim pNQ As INetworkQuery
&amp;nbsp; Set pNQ = pND
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp; Dim pEnumNE As IEnumNetworkElement
&amp;nbsp; Set pEnumNE = pNQ.Elements(esriNETEdge)
&amp;nbsp; 
&amp;nbsp; Dim pFromJunction As INetworkJunction
&amp;nbsp; Set pFromJunction = pNQ.CreateNetworkElement(esriNETJunction)
&amp;nbsp; 
&amp;nbsp; Dim pToJunction As INetworkJunction
&amp;nbsp; Set pToJunction = pNQ.CreateNetworkElement(esriNETJunction)
&amp;nbsp; 
&amp;nbsp; Dim pNE As INetworkElement
&amp;nbsp; Set pNE = pEnumNE.Next
&amp;nbsp; 
&amp;nbsp; Dim pNEdge As INetworkEdge
&amp;nbsp; Set pNEdge = pNE
&amp;nbsp; Dim i As Integer
 Open "c:\temp\ND_FromTo.csv" For Output As #1 'set path as needed
 Print #1, """EdgeOID"", ""FromOID"", ""ToOID"", ""Lenght_Attribute"""
&amp;nbsp; Do Until pNE Is Nothing
&amp;nbsp;&amp;nbsp;&amp;nbsp; pNEdge.QueryJunctions pFromJunction, pToJunction
&amp;nbsp;&amp;nbsp;&amp;nbsp; Print #1, pNE.OID; ","; pFromJunction.OID; ","; pToJunction.OID; ","; pNE.AttributeValue(1)
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pNE = pEnumNE.Next
&amp;nbsp; Loop
&amp;nbsp;&amp;nbsp; Close #1
&amp;nbsp;&amp;nbsp; 
End Sub
&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:14:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/calculate-the-fnode-tnode-of-a-polyline-shapefile/m-p/731788#M7044</guid>
      <dc:creator>NaserHdieb</dc:creator>
      <dc:date>2021-12-12T07:14:26Z</dc:date>
    </item>
    <item>
      <title>Re: calculate the fnode tnode of a polyline shapefile</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/calculate-the-fnode-tnode-of-a-polyline-shapefile/m-p/731789#M7045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Glad to know the VBA worked for you. It lists the edges that are stored in the network. It should be same as the number of arcs in your shape file. is your network dataset&amp;nbsp; up to date? That is, have you edited your shape file and not re-built the network? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jay Sandhu&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Apr 2013 15:34:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/calculate-the-fnode-tnode-of-a-polyline-shapefile/m-p/731789#M7045</guid>
      <dc:creator>JaySandhu</dc:creator>
      <dc:date>2013-04-18T15:34:23Z</dc:date>
    </item>
  </channel>
</rss>

