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"
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.