Hi All,
I‘m using the script to update layer data source in a project file (*.aprx). However , there is no connectionProperties for NetworkAnalystLayer.
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
Thanks,
Leo