So I am currently working on a tool that the user needs to apply a query in order to the run the tool for the queried data. I am trying to get around that by creating a blank dictionary in the script and then appending data to it. The data comes from a field in a feature class. I have never done this before but in theory it should work the same as appending to lists correct?
hubFeatures <SPAN class="operator token">=</SPAN> r<SPAN class="string token">'hub_locations'</SPAN>
hubDict <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">{</SPAN><SPAN class="punctuation token">}</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>These are my working variables for this. The field that I want the data from to append to the dictionary is called 'NAME' in the hubFeatures FC. I was thinking of using cursors to achieve this. Unless there is an alternative approach. The idea is to then use the items in the dictionary to apply a query to the necessary layers and complete the functionality of the tool using a for loop. That part I can do. Need some assistance in setting up the dictionary.