0

I am trying to create a script toool for Making XY Event layer , But having stuck with GetParameters function while running the script with an error window of "This tool has no parameters"

Here is my code

#Import system modules
import arcpy

import os

arcpy.env.workspace = Working

arcpy.env.overwriteOutput = True

# Script arguments
Input_Table = arcpy.GetParameterAsText(0)

Output_Workspace = arcpy.GetParameterAsText(1)

# Local variables:
XY_Event_Layer = Input_Table

X Cord = "Longitude"

Y_Cord = "Latitude"

spRef = arcpy.SpatialReference(4326)

Output_Workspace = "New_Feature_Class.shp"

# Process: Make XY Event Layer
arcpy.MakeXYEventLayer_management(Input_Table, "Longitude", "Latitude", XY_Event_Layer, spRef)

# Process: Feature Class to Feature Class
arcpy.CopyFeatures_management(XY_Event_Layer, Longitude_and_Latitude_Points, "", "0", "0", "0")
1

Parameters are created when you're adding your python script as a tool. enter image description here

enter image description here

Once a script is added you can access its properties to edit parameters. enter image description here

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.