Deletion of structural attachment association in bulk

231
1
12-05-2022 04:03 AM
GIS_Solutions
Occasional Contributor II

Hi,

I have defined Structure attachment rule between Structure Junction feature and Electrical Junction feature.
I created about 40,000 attachments using the Append tool. How can I remove these attachments from data in bulk.

//$feature is an ElectricJunction
var sjFeatureSet = FeatureSetByname($datastore, "StructureJunction", ["objectid"] ,false)

// Asset Group	101-102-103-104-105
// Asset Type	111-112-120-121-122-130-131-132-133-134-381-382-383-470-471-473-474-475-476-477-478-479-480-481-482

var polesFeatureSet = Filter(sjFeatureSet, "ASSETGROUP in (101,102,103,104,105) AND ASSETTYPE in (111,112,120,121,122,130,131,132,133,134,381,382,383,470,471,473,474,475,476,477,478,479,480,481,482)")

//buffer
var g = buffer($feature, 0)

var intersectedPoles = Intersects(polesFeatureSet,g)

if (count(intersectedPoles) == 0) 
  return $feature.Note;

var pole = first(intersectedPoles)

return {

         "result": $feature.Note,
         "edit": 
              [
                {
                 "className": "structurejunction",

                 "updates":
                 [
                   {
                   "objectID": pole.objectid,
                   "associationType": 'structure'
                   }
                 ]
                }
              ]
            }

 

existing association.jpg

 

0 Kudos
1 Reply
jclarke
New Contributor III

You can delete associations via Arcade e.g. https://community.esri.com/t5/arcgis-utility-network-questions/create-an-attribute-rule-to-delete-th...

Could you combine this with a batch calculation attribute rule?

0 Kudos