Select to view content in your preferred language

Attribute rules in Arc GIS Pro

3301
15
04-13-2023 08:02 AM
AndrewReynoldsDevon
Regular Contributor

I need to do a 4 spatial queries against different polygon features. The 4 polygon features all have the same field name of 'Name' but the field in the point feature is as such, Ward, Parish, County & District. 

For attribute rules to work like this do the tables need to be joined?

I'd like to do start with an immediate calculation rule so that when a point is created 4 spatial queries are done at the same time but then once is working I need to use the batch feature & apply these rules to 2 million items of data. 

The spatial rule will need to be something like which polygon feature does this point exist in?

0 Kudos
15 Replies
AndrewReynoldsDevon
Regular Contributor

I've used Model Builder to add the 4 fields successfully & to import the attribute rule to the point FC.

The next hurdle is the code you use below to trigger the updates. It works in python but what do I need to enter into the 'Parish= ' calculation box?

arcpy.management.CalculateField(fc, "Ward", "null", "ARCADE")

5.JPG

0 Kudos
JohannesLindner
MVP Alum

Literally anything. You just want to trigger the Attribute Rule, and the rule will calculate a new value for the Parish field.

//Parish = 
"abc"

Have a great day!
Johannes
0 Kudos
AndrewReynoldsDevon
Regular Contributor

I've tried using the code earlier to create the 4 fields however I'm getting the below error

 

4.JPG

0 Kudos
JohannesLindner
MVP Alum

You forgot the path to the database.

fc = "path:/to/your/database.sde/CorGIS.CORMGR.Blablabla"

Have a great day!
Johannes
0 Kudos
AndrewReynoldsDevon
Regular Contributor

I've created a new table & the model imports the attribute rule that was exported from the old table but get an error now saying that it can't execute the calculation as that old table doesn't exist anymore however it's not referenced anywhere in the python code or model?

Do I need to create an attribute rule in this new table for it to work?

6.JPG

0 Kudos
JohannesLindner
MVP Alum

That's the same error as in your previous reply. Did you actually change the fc path to include the databas?

 


Have a great day!
Johannes
0 Kudos