Esri / Utility-Data-Management-Support-Tools

A set of tools to work with the utility network and their maps.
Apache License 2.0
23 stars 4 forks source link

Configure UN Layers: Subtype Group Layer #4

Closed vertigork closed 2 years ago

vertigork commented 2 years ago

Describe the bug When the tool is run against a map that contains subtype group layers it will fail saying it cannot find the subtype layer.

To Reproduce Steps to reproduce the behavior:

  1. Open the Configure UN Layers tool
  2. Select a map containing subtype group layers (the Electric Network Editor map in the Electric Foundation solution contains subtype group layers)
  3. Check the "Rule Popup" option
  4. Click Run
  5. The tool will fail on the first subtype layer in the map

Expected behavior The tool should complete without warnings or errors. The popups should be applied to each subtype layer in the subtype group layer. Esri best practices is to use subtype group layers, and the electric foundation maps provided by Esri contain subtype group layers so there is an expectation that this is supported.

Screenshots Start Time: Tuesday, December 28, 2021 10:27:21 AM udms.logic.add_popups( map_name='Utility Network - Popup', pro_project='CURRENT', options=['RULE_POPUP'], category_filters=None, ) Describing Utility Network Updating layers with rule popup Electric Device\High Voltage Switch Traceback (most recent call last): File "", line 20, in File "C:\Code\Utility-Data-Management-Support-Tools\UtilityDataManagementSupport.atbx\udms\esri.py", line 87, in wrapper File "C:\Code\Utility-Data-Management-Support-Tools\UtilityDataManagementSupport.atbx\udms\logic__init__.py", line 330, in add_popups File "C:\Code\Utility-Data-Management-Support-Tools\UtilityDataManagementSupport.atbx\udms\logic\popup.py", line 319, in main File "C:\Code\Utility-Data-Management-Support-Tools\UtilityDataManagementSupport.atbx\udms\logic\popup.py", line 241, in add_rule_popup File "C:\Code\Utility-Data-Management-Support-Tools\UtilityDataManagementSupport.atbx\udms\logic\popup.py", line 139, in _add_rule_cim File "C:\Code\Utility-Data-Management-Support-Tools\UtilityDataManagementSupport.atbx\udms\logic\popup.py", line 83, in _prepare_popup File "C:\Code\Utility-Data-Management-Support-Tools\UtilityDataManagementSupport.atbx\udms\logic\popup.py", line 69, in _create_default_popup File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy__init__.py", line 1166, in ListFields return gp.listFields(dataset, wild_card, field_type) File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing_base.py", line 354, in listFields self._gp.ListFields(*gp_fixargs(args, True))) OSError: "High Voltage Switch" does not exist Failed script (null)... Failed to execute (ConfigureUtilityNetworkLayers). Failed at Tuesday, December 28, 2021 10:27:29 AM (Elapsed Time: 7.96 seconds)

Desktop (please complete the following information):

Additional context The Utility Network File Geodatabase and Maps provided by the Esri in the Electric Foundations solution can be used to reproduce the issue

pLeBlanc93 commented 2 years ago

I can repro the failure on active projects.

It works correctly when using a Pro project on disk instead of CURRENT.

MikeMillerGIS commented 2 years ago

@vertigork can you verify?

vertigork commented 2 years ago

i'll test this out ASAP

vertigork commented 2 years ago

@MikeMillerGIS tested in ArcGIS Pro against an active project, active map, with subtype group layers.