I have 3 attribute rules already working which are spatial lookups when a point/line/poly is created & the line/polygon work fine. If I hold Ctrl to enable snapping when creating a point the look ups work however when I don't do this the point doesn't auto snap to the polyline feature so the code which is using intersect to carry out the lookups doesn't work.
I have the below code which works when snapping is enabled with CTRL but I either need to modify this code to add in the function of Auto-Snap or a attribute rule to enable auto snapping when creating point features.
// load the other featureset
var fs = FeatureSetByName($datastore, "Highways.HIGHWAYMGR.NSG_Network")
// get the first feature from fs that intersects the current $feature
var f = First(Intersects(fs, $feature))
// abort if we didn't find something
if(f == null) { return }
// return the intersecting feature's value
return f.NSG_STREETS_UID