I am trying to return a feature class (my sample data is a polygon fc) from a Python toolbox and cannot find any information about what I have to set to get it to work. This runs successfully and gives me a record count of 917 but in ArcCatalog in the results window out: (and the icon looks like a table not a polygon feature class).
import arcpyclass Toolbox(object): def __init__(self): self.label='BasicOutput' self.alias='BasicOutput' self.description='BasicOutput' self.summary=self.description # List of tool classes associated with this toolbox self.tools=[BasicOutput]class BasicOutput(object): def __init__(self): """Define the tool (tool name is the name of the class).""" self.label='BasicOutput' self.description='BasicOutput' self.summary=self.description def getParameterInfo(self): ps=[ arcpy.Parameter( displayName='out', name='out', datatype='GPFeatureRecordSetLayer', parameterType='Derived', direction='Output'), ] return ps def updateParameters(self,parameters): return def updateMessages(self,parameters): return def execute(self,parameters,messages): fs=arcpy.FeatureSet() fs.load(r'D:\customApps\PaddockGRASP\BasicOutput.gdb/Cadastre') arcpy.AddMessage('record count: %s'%arcpy.GetCount_management(fs)) parameters[0].value=fsI will then be publishing it as a GP service in ArcGis server, but can't even get it working in ArcCatalog! Using ArcGis 10.2.1.
أكثر...
import arcpyclass Toolbox(object): def __init__(self): self.label='BasicOutput' self.alias='BasicOutput' self.description='BasicOutput' self.summary=self.description # List of tool classes associated with this toolbox self.tools=[BasicOutput]class BasicOutput(object): def __init__(self): """Define the tool (tool name is the name of the class).""" self.label='BasicOutput' self.description='BasicOutput' self.summary=self.description def getParameterInfo(self): ps=[ arcpy.Parameter( displayName='out', name='out', datatype='GPFeatureRecordSetLayer', parameterType='Derived', direction='Output'), ] return ps def updateParameters(self,parameters): return def updateMessages(self,parameters): return def execute(self,parameters,messages): fs=arcpy.FeatureSet() fs.load(r'D:\customApps\PaddockGRASP\BasicOutput.gdb/Cadastre') arcpy.AddMessage('record count: %s'%arcpy.GetCount_management(fs)) parameters[0].value=fsI will then be publishing it as a GP service in ArcGis server, but can't even get it working in ArcCatalog! Using ArcGis 10.2.1.
أكثر...