ArcGIS Utility Network: Using programming to batch enable Subnetwork Controller

859
6
Jump to solution
06-15-2022 02:36 AM
YiuTungNicholasTse
New Contributor II

Hi all,

I have a bunch of points that I would like to turn them into Subnetwork controllers, normally to modify the Subnetwork controller you have to manually input the information. For my case I have thousands of node to enable Subnetwork controller, I am not familiar with programming but I was wondering if there are any ways to write a python code that allows me to batch enable subnetwork controller. 

 

0 Kudos
1 Solution

Accepted Solutions
RobertKrisher
Esri Regular Contributor

The easiest and safest way to accomplish this is to create a CSV file with all the required information to create the controllers and use the Import Associations tool. If you follow the provided link to the online help which columns are required and how to run the tool.

View solution in original post

0 Kudos
6 Replies
RobertKrisher
Esri Regular Contributor

The easiest and safest way to accomplish this is to create a CSV file with all the required information to create the controllers and use the Import Associations tool. If you follow the provided link to the online help which columns are required and how to run the tool.

0 Kudos
GIS_Solutions
Occasional Contributor II

Hi @RobertKrisher 

Is there a method that does the reverse of this process?
I want to cancel the assigned Subnetwork Controllers. I need to remove nearly 500 controllers in total, can we do this with csv?

0 Kudos
RobertKrisher
Esri Regular Contributor

@GIS_Solutions The easiest way would be to export your data to an asset package and delete any rows out of the C_Subnetworks table that you don't want. You're only other option would be to use the ArcGIS API for Python (or other code) to access the REST endpoint of the utility network and call Disable Subnetwork Controller—ArcGIS REST APIs | ArcGIS Developers. We don't let you edit the subnetworks table directly to mark subnetworks as dirty.

0 Kudos
GIS_Solutions
Occasional Contributor II

Thank you @RobertKrisher 

I am trying to run it via rest service, but I was not successful. What should we pay attention to here? I get the response Success=True, but the controller still appears as True.

 

disableSubnetworkController.jpg

0 Kudos
RobertKrisher
Esri Regular Contributor

The fact that there weren't any service edits returned is a little suspicious (check your server logs for any message, and you can increase the logging level temporarily if you really want to dig in). I was able to verify that this worked on my end using the following parameters, looking directly at the subnetwork table without coded values helped me make sure i put everything in correctly.

RobertKrisher_2-1699456262060.png

 

Afterwards i was able to confirm that the subnetwork controller was marked as deleted. If you had your ArcGIS Pro session open when you ran the command you may need to refresh your view of default to look at the latest edit moment by selecting the version in your list by data source tab and selecting refresh on the version tab.

RobertKrisher_0-1699456167244.png

Once I did that i was able to see my subnetwork controller marked as deleted. From here I would follow the rest of the process for purging the subnetwork from my system (update subnetwork, export subnetwork w/ack).

RobertKrisher_1-1699456228084.png

 

 

GIS_Solutions
Occasional Contributor II

Thank you @RobertKrisher 

It gave an error because I entered the SourceID value incorrectly. Thank you for your quick reply and testing.

0 Kudos