Automate attribution update?

5410
25
03-09-2016 03:42 AM
RobRees
New Contributor II

Hi guys,

I have a project I am working on which involves me snapping one set of nodes to another set, one by one.

Once this is done I need to update 2 blank fields in one node. One involves copying the item number from one node to the other. And the other update involves inserting a number into a blank field to indicate the node has been paired.

I wondered if there is a way to automate this? i presume this would involve some Python scripting which I am fairly new to, so any simplified advice would be appreciated.

Thanks

Ray

0 Kudos
25 Replies
RobRees
New Contributor II

Hi Richard,

Thank you for the detailed reply, it was very helpful. I actually spent some more time on it after my previous post and was heading in this direction, thankyou for confirming. I will hopefully get this set up soon and will let you know how I get on.

Thanks again.

0 Kudos
PriscillaCole
New Contributor II

Richard - I love all of your good advice on this thread. It's been helpful to think of VB expressions in the dynamic value table like those in the field calculator.

I've got a problem that I'm hoping you could help me with. I'd like to use attribute assistant to populate fields according to the properties of the map document. The arcpy mapping module opens these properties up nicely, but I have no idea how to accomplish the same with visual basic. Ideally, I'd like to access the map title, but I'd also settle for the mxd name or version name. Below, I used a python function in the field calculator to accomplish what I want by pulling the map title.

How can I get this same logic into the dynamic value table?

0 Kudos
RichardFairhurst
MVP Honored Contributor

Unfortunately VB Script cannot be used to get a map document title or anything else from the map document.  That used to be possible when ArcMap supported VBA, which could use ArcObjects to access those properties, but all ArcObjects code was dropped once VB Script became the basis of the field calculator.  Now only Python can be used to do anything related to mapping or Add Ins/Extensions built using Visual Studio and .Net/ArcObjects.

You could try building a Python Add In Editor Extension which could listen for edit events and attempt to trigger the update with your calculation code, but the Python Editor Extension Add In does not really work well and is very limited and frustrating  to work with, and the .Net Editor Extension is much better.  The Python Add In Editor Extension is essentially unusable if you edit in SDE, it is really only somewhat OK if you edit shapefiles/fgdb/personal gdb data.  Edits triggered by the Python Editor Extension cannot be undone by the user and the user either has to save all edits or stop the Edit session and lose all edits.

Anyway, you have to give up on Attribute Assistant for the functionality you want.  It is simply incapable of doing this.

0 Kudos
DarrenWiens2
MVP Honored Contributor
Once this is done I need to update 2 blank fields in one node. One involves copying the item number from one node to the other. And the other update involves inserting a number into a blank field to indicate the node has been paired.

Since you're doing this after you've completed your editing, I'm not sure why Spatial Join​, which will transfer all the attributes from the old nodes to the intersecting/nearest (?) new nodes, wouldn't take care of this for you.

0 Kudos
RobRees
New Contributor II

Hi Darren,

Yes I may look into spatial join after i have managed to get attribute assistant working.

The reason i didnt use spatial join is that the table ares amended in microsoft access after I have moved the nodes to the correct position and updated attribution.

Creating a spatial join would create a new merged table, so now we would have three tables? I do not currently have control over the data after I have edited it so it maybe something i could pursue in the future.

Thanks.

0 Kudos
RobRees
New Contributor II

Hi Richard, Intersecting_feature works perfectly, thank you.

I was trying to do the second part which involves updating another field to the value of 1 to indicate the nodes have been paired.

I entered another record into the dynamic value table to do this and tried using Field_Trigger but the field did not seem to get updated.

Is there a different method I should be using?

I have been running the attribute assistant manually, so once I have selected several nodes I run the attribute assistant, which now copies the field from the snapped node into this node, but now I need another filed to be updated to 1.

Any advice would be appreciated.

Thanks,

Ray.

0 Kudos
RichardFairhurst
MVP Honored Contributor

I would use the EXPRESSION method, which can verify that the Node_ID field is not NULL before changing the other field to 1.

The Expression record in the Dynamic Table must have been inserted after the record that intersects the node for this to work and the Rule Weight must be Equal To or Greater Than the value for the Rule Weight of the Node Intersect rule.

OBJECTID *Table NameField NameValue MethodValue InfoOn CreateOn Change (Attribute)On Change (Geometry)Manual OnlyRule WeightComments
193CENTERLINECITY_LEFTEXPRESSIONIIF(IsNull([NODE_ID]),[CITY_LEFT],1)FalseFalseFalseTrue1<Null>

In the rule above, the expression determines if a field named NODE_ID is Null.  If NODE_ID is Null it does not change the CITY_LEFT value (it sets the value of CITY_LEFT to itself so that it retains is current value), otherwise it sets CITY_LEFT to 1

Edit 3/24/2016 - Added missing end parenthesis to Value Info expression.

RobRees
New Contributor II

Hi Richard,

Thanks again for a detailed reply. I am going to try and implement this tonight.

I had one other question for you..

Is there a way to get attribute assistant to work on version 10.0 ArcGIS? I have been using it successfully on higher versions(on a different laptop) but now I am stuck with version 10.0 and not able to upgrade.

Thanks,

Ray.

0 Kudos
RobRees
New Contributor II

Hi Richard, trying to get the expression to work.. is there a parentheses missing in the code?

Thanks,

Rob

RichardFairhurst
MVP Honored Contributor

Yes there was a missing parenthesis at the end of the Value Info expression. I have corrected the error in my post.

0 Kudos