F_Kellner

Reference the path to a file that is in a current edit session

Discussion created by F_Kellner on Aug 23, 2013
Greetings,

I have created a Python addin button. I currently have the name of specific file embedded in the addin python code. I will like to the script to be able to search for the file that is currently open in an edit session, rather than have to have a specific file name. This will also make sure that tool is not used outside of an edit session when changes can not be reversed.

def __init__(self):
        self.enabled = True
        self.checked = False
    def onClick(self):
  inFeatures="m8010_seginit_061213"
  fieldName="LFM"
  expression=3000
  arcpy.CalculateField_management(inFeatures, fieldName, expression, "PYTHON")


I would like to the variable "inFeatures" to be equal something like "CURRENT" or whatever the path is to the file that is currently open for editing.

Any ideas?

Thanks

Fred

Outcomes