A few pointers:
- You can define in your tool a parameter type "Point". This will provide two input boxes to specify the X and Y coordinates. The result (when read as text) is a string containing "Xvalue Yvalue"
- When I tested a snippet of code I received an error indicating that the input feature falls outside the output geometry domain. So an spatial reference is probably required. Define a second parameter with type "Spatial Reference"
- The third parameter in this case will be output featureclass. Set the direction to output.
- In the line where you use the "arcpy.CopyFeatures_management" you have to provide an output featureclass as second parameter
Se below the code for this tool:import arcpy
arcpy.env.overwriteOutput = True
# Point, input
pnt_in = arcpy.GetParameterAsText(0)
arcpy.AddMessage("Input pnt_in: {0}".format(pnt_in))
# Spatial Reference, input
sr = arcpy.GetParameter(1)
arcpy.AddMessage("Input sr: {0}".format(sr))
# Featureclass, output
fc = arcpy.GetParameter(2)
arcpy.AddMessage("Input fc: {0}".format(fc))
# split the XY coordinates text into a list
lst = pnt_in.split()
arcpy.AddMessage("lst: {0}".format(lst))
# create a point object from the X and Y values in the list
pnt = arcpy.Point(lst[0], lst[1])
arcpy.AddMessage("pnt: X={0} Y={1}".format(pnt.X, pnt.Y))
# create a point geometry object point object and apply the spatial reference
pnt_geom = arcpy.PointGeometry(pnt, sr)
arcpy.AddMessage("pnt_geom: X={0} Y={1}".format(pnt_geom.firstPoint.X, pnt_geom.firstPoint.Y))
# create the output featureclass,
arcpy.CopyFeatures_management(pnt_geom, fc)
arcpy.AddMessage(arcpy.GetMessages())
# your third parameter is already set in the dialog, no need to use the "arcpy.SetParameterAsText"
Hope this helps you. Kind regards,Xander