<?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: Disable subnetwork controller in utility network, ArcGIS Pro sdk in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/disable-subnetwork-controller-in-utility-network/m-p/1408997#M11366</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/114916"&gt;@RichRuh&lt;/a&gt;&amp;nbsp;sorry for the mention but i think you are the right person to ask&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it's possible the method DisableControllerInEditOperation works only with the UN on service and not with UN in the gdb file?&lt;/P&gt;</description>
    <pubDate>Fri, 12 Apr 2024 14:52:50 GMT</pubDate>
    <dc:creator>DanieleChiara</dc:creator>
    <dc:date>2024-04-12T14:52:50Z</dc:date>
    <item>
      <title>Disable subnetwork controller in utility network, ArcGIS Pro sdk</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/disable-subnetwork-controller-in-utility-network/m-p/1405703#M11330</link>
      <description>&lt;P&gt;Hi, I need to develop an add-In to work with utility network. After clicking a button, programmatically disable all subnetwork controllers that have a certain globalId within my device layer in map. For testing purposes, I tried to operate with only one subnetwork controller, in order: create an element, get subnetworkManager from un, disable controller in edit operation, save the project and then do subnetwork update. Sequential operations as in the documentation example&lt;BR /&gt;&lt;A title="https://pro.arcgis.com/en/pro-app/3.0/sdk/api-reference/topic76342.html" href="https://pro.arcgis.com/en/pro-app/3.0/sdk/api-reference/topic76342.html" target="_blank" rel="noreferrer noopener"&gt;https://pro.arcgis.com/en/pro-app/3.0/sdk/api-reference/topic76342.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;What I notice is that no Dirty Area is created, as if the editing is not being done. I tried as well the DisableController method without editing operation and did not get the desired result.&lt;BR /&gt;I am currently using version 3.2.2 of Pro and Geodatabase File.&lt;BR /&gt;What am I doing wrong?&lt;/P&gt;&lt;P&gt;CODE SNIPPET:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;globalIdSBC.Clear();
globalIdSBC.Add("{77725B0F-B758-4D54-B1D9-4A927CC14F01}");

// globalId string list
string globalIdStringList = string.Join(",", globalIdSBC.Select(id =&amp;gt; $"'{id}'"));


QueryFilter filter = new QueryFilter
{
    WhereClause = $"GLOBALID IN ({globalIdStringList})"
};
// filter.SubFields = "GLOBALID, OBJECTID";

// Count
int rowCount = GetFilteredFeatureCount(deviceLayer, filter);

Debug.WriteLine($"Count: {rowCount}");

var tierD = domainNetwork.GetTier("Distribuzione Primo Salto");
if (tierD == null)
{
    Debug.WriteLine($"Tier: {tierD}");
    return;
}

var subnetworks = utilityNetwork.GetSubnetworkManager().GetSubnetworks(tierD, SubnetworkStates.All);
var subnetwork = subnetworks.FirstOrDefault(x =&amp;gt; x.Name == "R_GorlaMaggiore");


using (var cur = deviceLayer.Search(filter))
{
    ArcGIS.Core.Data.UtilityNetwork.Element element = null;
    while (cur.MoveNext())
    {                    
        var currentRow = cur.Current;

        // Element from row
        element = utilityNetwork.CreateElement(currentRow);
        // Disable snc 
        utilityNetwork.GetSubnetworkManager().DisableControllerInEditOperation(element);

        // Tried also validate network topology first
        UtilityNetworkExtensions.ValidateNetworkTopologyInEditOperation(utilityNetwork);

        // Save edits and update subnetwork
        await Project.Current.SaveEditsAsync();
        subnetwork.Update();
    }
}

// Save edits
// await Project.Current.SaveEditsAsync();

// I tried update both ways 
//foreach (Tier tier in domainNetwork.Tiers)
//{
//    utilityNetwork.GetSubnetworkManager().UpdateAllSubnetworks(tier, true);
//}

//foreach (Tier tier in domainNetwork.Tiers)
//{
//    var subnetworks = utilityNetwork.GetSubnetworkManager().GetSubnetworks(tier, SubnetworkStates.Dirty);
//    foreach (Subnetwork subnetwork in subnetworks)
//    {
//        subnetwork.Update();
//    }
//}

// subnetwork.Update();
mapView.Redraw(true);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 13:44:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/disable-subnetwork-controller-in-utility-network/m-p/1405703#M11330</guid>
      <dc:creator>robertoquartarone</dc:creator>
      <dc:date>2024-04-04T13:44:56Z</dc:date>
    </item>
    <item>
      <title>Re: Disable subnetwork controller in utility network, ArcGIS Pro sdk</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/disable-subnetwork-controller-in-utility-network/m-p/1405833#M11332</link>
      <description>&lt;P&gt;The DisableControllerWithEditOperation should create a dirty area, and calling ValidateNetworkTopologyInEditOperation should clean it so you don't see it.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 15:54:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/disable-subnetwork-controller-in-utility-network/m-p/1405833#M11332</guid>
      <dc:creator>Aashis</dc:creator>
      <dc:date>2024-04-04T15:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: Disable subnetwork controller in utility network, ArcGIS Pro sdk</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/disable-subnetwork-controller-in-utility-network/m-p/1406340#M11337</link>
      <description>&lt;P&gt;Hello Aashis,&lt;BR /&gt;I thank you for your kind reply. I had not used the ValidateNetworkTopology initially and still the result was the same.&lt;BR /&gt;The dirty area is not generated at all because the subnetwork controller remains as such even after disabling, so it is not disabled&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2024 14:01:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/disable-subnetwork-controller-in-utility-network/m-p/1406340#M11337</guid>
      <dc:creator>robertoquartarone</dc:creator>
      <dc:date>2024-04-05T14:01:50Z</dc:date>
    </item>
    <item>
      <title>Re: Disable subnetwork controller in utility network, ArcGIS Pro sdk</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/disable-subnetwork-controller-in-utility-network/m-p/1408997#M11366</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/114916"&gt;@RichRuh&lt;/a&gt;&amp;nbsp;sorry for the mention but i think you are the right person to ask&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it's possible the method DisableControllerInEditOperation works only with the UN on service and not with UN in the gdb file?&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2024 14:52:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/disable-subnetwork-controller-in-utility-network/m-p/1408997#M11366</guid>
      <dc:creator>DanieleChiara</dc:creator>
      <dc:date>2024-04-12T14:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: Disable subnetwork controller in utility network, ArcGIS Pro sdk</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/disable-subnetwork-controller-in-utility-network/m-p/1409050#M11367</link>
      <description>&lt;P&gt;Ciao Daniele,&lt;/P&gt;&lt;P&gt;No, the DisableControllerInEditOperation works equally well with feature services, file&amp;nbsp;geodatabases, and mobile&amp;nbsp;geodatabases.&lt;/P&gt;&lt;P&gt;Are you sure the feature that you are passing to DisableControllerInEditOperation is, in fact, a subnetwork controller?&lt;/P&gt;&lt;P&gt;--Rich&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2024 15:57:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/disable-subnetwork-controller-in-utility-network/m-p/1409050#M11367</guid>
      <dc:creator>RichRuh</dc:creator>
      <dc:date>2024-04-12T15:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: Disable subnetwork controller in utility network, ArcGIS Pro sdk</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/disable-subnetwork-controller-in-utility-network/m-p/1409080#M11368</link>
      <description>&lt;P&gt;Hi Rich. Thanks for the fast reply.&lt;/P&gt;&lt;P&gt;Yes we are sure that the feature is a subnetwork controller (we pass directly the Global ID and the method)&lt;/P&gt;&lt;P&gt;the strange thing is that the save and discard buttons are enable but no dirty areas are created and no error was return in the whole process.&amp;nbsp;&lt;/P&gt;&lt;P&gt;A screen on what i see in the PRO (Before and after the process)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DanieleChiara_0-1712939481489.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/100830i737CC41CECE7BBF7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DanieleChiara_0-1712939481489.png" alt="DanieleChiara_0-1712939481489.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;the snippet of the code.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;string&amp;nbsp; globalIdStringList = "'{597AD203-0637-4ABB-B628-6497D3CB74EA}'";&lt;BR /&gt;QueryFilter filter = new QueryFilter&lt;BR /&gt;{&lt;BR /&gt;WhereClause = $"GLOBALID IN ({globalIdStringList})"&lt;BR /&gt;};&lt;BR /&gt;filter.SubFields = "GLOBALID, OBJECTID";&lt;/P&gt;&lt;P&gt;using (var cur = deviceLayer.Search(filter))&lt;BR /&gt;{&lt;BR /&gt;ArcGIS.Core.Data.UtilityNetwork.Element element = null;&lt;BR /&gt;while (cur.MoveNext())&lt;BR /&gt;{&lt;BR /&gt;element = utilityNetwork.CreateElement(cur.Current);&lt;BR /&gt;utilityNetwork.GetSubnetworkManager().DisableControllerInEditOperation(element);&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;We miss something?&lt;/P&gt;&lt;P&gt;We try with pro 3.1.3 and 3.2.2 and enterprise 11.1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2024 16:37:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/disable-subnetwork-controller-in-utility-network/m-p/1409080#M11368</guid>
      <dc:creator>DanieleChiara</dc:creator>
      <dc:date>2024-04-12T16:37:55Z</dc:date>
    </item>
  </channel>
</rss>

