Hello. I have a python code in the ArcMap field calculator that translates numbers in the Id-column to text in another column in the same attribute table. In the pre-logic-script It looks like this:
def reclass(Id):
if (Id == 0):
return "AAA"
if (Id == 1):
return "BBB"
if (Id == 2):
return "CCC"
if (Id == 3):
return "DDD"
if (Id == 4):
return "EEE"
if (Id == 5):
return "FFF"
if (Id == 6):
return "GGG"
else:
return "<Null>"and in the other box:
reclass(!Id!)
The problem is that this code disapears every time I shut down arcMap, and have to be re-loaded when I add anything. For example if I add an object with id-class 2 it doesn't automatically writes CCC in the new column iuntill I have re-runed the script.
Is there some way I can automatically run this script as soon as I open / change anything the attribute table?