Hi all,
I've come across a puzzling problem with attribute constraint rules in ArcGIS Pro that I could use some help with.
I set up a rule to keep specific point features inside certain polygons, and it works perfectly during inserts. But when I try to move a feature outside its designated polygon during an update, the rule triggers, I get the error message, but the edit still happens.
Has anyone else faced this issue? Any insights would be greatly appreciated.
Thanks,
Stefan
PS: This is the code i am working with:
// Create a feature set of intersecting StructureBoundaries
var intersectingBoundaries = Intersects(FeatureSetByName($datastore, 'StructureBoundary'), $feature);
// Initialize a boolean variable to track if the point touches any boundary edge
var touchesEdge = false;
// Loop through intersecting StructureBoundaries
for (var boundary in intersectingBoundaries) {
// Check if the point feature touches the edge of the current boundary
if (Touches($feature, boundary)) {
// Set parameter to true if edge is not allowed (device and junction (except wall bushing)) for assembly set on false
touchesEdge = EDGE_PARA;
break; // Exit loop since we found a touching boundary
}
}
// Check if feature intersects a boundary
if(touchesEdge){
return false;
} else if(count(intersectingBoundaries) > 0) {
return true;
} else {
return false;
}