I've been dabbling with attribute assistant for awhile. I'm just starting a project to enter a backlog of water and sewer features. I needed a way to speed editing up. I use the water utility network editing toolbar and I know that it can work with attribute assistant. I decided it was time to get serious about how to use these methods.
Scenario: Fire hydrants are assigned IDs sequentially regardless of the grid they fall within. How can I use the methods to build an ID that includes a static value + sequential ID + grid #? Example: FH12345D2
Solution: Use multiple methods with rule weights from high to low to step through each method in a prescribed way. Use other fields as placeholders and then remove those values at the end.
Discussion: Initially I used GENERATE_ID method to create the ID. Pretty easy. waFireHydrantID|5|FH|[seq]|True. I looked at GENERATE_ID_BY_INTERSECT but I realized (after some time) it results in separate sequential IDs within each grid because it requires a separate seqname in the GenerateID table for each grid. Not what I need.
After a few rounds of testing that included some virtual head pounding I saw a thread on Geonet that made me realize 1) use multiple methods and 2) weighting is a number where 1 is not the highest but the lowest number.
Note: The numbers I used for the rule weights did not have to be that high. I did it to make it really obvious to me.
Note:The 4th method for the ID_NUM field is not needed to build the ID but it is part of my workflow so I left it in there to show the VBscript function I used to retrieve the number part of the ID. Note: W3Schools sometimes gets bashed online but for me it has the clearest list of VBscript examples. VBScript Functions
Note: These methods only run on creation so the placeholder values are not overwriting any existing values.
I applied this same set of methods to a second scenario with sewer manholes.
Scenario: Sewer manholes are assigned IDs made up of the first letter in the sewer shed name + a sequential id + grid number. Example: C1234E4
This solution led me to use the From and To Junction field methods for the first time on sewer pipes.
Scenario: The sewer pipe ID is built from a static value + the UPSTREAM_ID. Example: SPC1234E4
The UPSTREAM_ID is created when the manhole ID is created (from the scenario above). When a new line is snapped to the upstream Manhole and the the downstream manhole the rules run in weight order.