I initially posted a question regarding the use of the GpFeatureRecordSetLayer Parameter in a Python Toolbox I am creating.
Original Question: Using GPFeatureRecordSetLayer in Python Toolbox for ArcMap?
In summary when running the Toolbox in any version of ArcMap from 9.x to 10.4 a bug in the system would not recognise the GPFeatureRecordSetLayer. The purpose of this layer is to allow the user to generate a polygon defining a study area from which the Tool would run.
I have been considering alternatives, and was thinking having an edit session start when the tool is opened allowing for the editing of a explicitly defined Polygon Layer might be the solution.
My question is: Is it possible to initiate an edit session, editing an existing layer when a Tool / Toolbox is opened? If so, where would you call the edit session? My thought would be within defining the parameters, but I am not sure how best to handle this in the code.
Please see my original code below:
def getParameterInfo(self): '''parameter definitions for GUI''' params = None param0 = arcpy.Parameter( displayName = "AOI", name = "Choose you Area of Interest", datatype = "GPFeatureRecordSetLayer", parameterType = "Required", direction = "Input") param0.value = r"C:\Data\AOI.lyr" param1 = arcpy.Parameter( displayName = "Project Name", name = "Please provide a project for this search", datatype = "GPString", parameterType = "Required", direction = "Input") param1.value = "Input Text" param2 = arcpy.Parameter( displayName = "Project Identifier", name = "Please provide an unique identifer for this search - Text Only", datatype = "GPString", parameterType = "Required", direction = "Input") param2.value = "Input Text" params = [param0 , param1, param2] return params