<?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 How to update the data source for Network Analyst Layer by arcpy in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-update-the-data-source-for-network-analyst/m-p/1577124#M92117</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I‘m using the script to update layer data source in a project file (*.aprx).&amp;nbsp; However , there is no connectionProperties for NetworkAnalystLayer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def _update_layer_data_source(layer, database, dataset):
    try:
        if layer.isNetworkAnalystLayer:
            # The attribute 'connectionProperties' is not supported on this instance of Layer.
            pass
        else:
            layer_connection_properties = layer.connectionProperties
            layer_connection_properties['connection_info']['database'] = database
            layer_connection_properties['dataset'] = dataset
            layer.updateConnectionProperties(layer.connectionProperties, layer_connection_properties)
    except Exception as ex:
        pass&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;Thanks,&lt;BR /&gt;Leo&lt;/P&gt;</description>
    <pubDate>Mon, 20 Jan 2025 05:58:26 GMT</pubDate>
    <dc:creator>LeoDeng</dc:creator>
    <dc:date>2025-01-20T05:58:26Z</dc:date>
    <item>
      <title>How to update the data source for Network Analyst Layer by arcpy</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-update-the-data-source-for-network-analyst/m-p/1577124#M92117</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I‘m using the script to update layer data source in a project file (*.aprx).&amp;nbsp; However , there is no connectionProperties for NetworkAnalystLayer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def _update_layer_data_source(layer, database, dataset):
    try:
        if layer.isNetworkAnalystLayer:
            # The attribute 'connectionProperties' is not supported on this instance of Layer.
            pass
        else:
            layer_connection_properties = layer.connectionProperties
            layer_connection_properties['connection_info']['database'] = database
            layer_connection_properties['dataset'] = dataset
            layer.updateConnectionProperties(layer.connectionProperties, layer_connection_properties)
    except Exception as ex:
        pass&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;Thanks,&lt;BR /&gt;Leo&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2025 05:58:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-update-the-data-source-for-network-analyst/m-p/1577124#M92117</guid>
      <dc:creator>LeoDeng</dc:creator>
      <dc:date>2025-01-20T05:58:26Z</dc:date>
    </item>
  </channel>
</rss>

