I am writing a python script to be added to a toolbox and I do not know how to call an existing tool to be a parameter.
import geocoder ##geocoding library
import csv
import arcpy ##ArcGIS python module
import arcgisscripting
arcpy.env.overwriteOutput = True
gp = arcgisscripting.create()##creating geoproccessing object
env = arcpy.GetParameterAsText(0)
gs = arcpy.GetParameterAsText(1) ##csv containing thousands of rows to be reverse geocoded
cc = gp.SearchCursor(gs) ##creating arcpy searccursor to open and read csv
z=0
for add in cc: ##looping thru all rows in csv
Company = str(add.Company)
Address = str(add.Address)
City = str(add.City)
State = str(add.State)
Zip = str(add.Zip)
geo = geocoder.google(str([Address,City,State,Zip]))
addr = geo.latlng ##returning xy for each row
print addr
if addr:
x = addr[1]
y = addr[0]
firstrow = "Company"+","+"Address"+","+"X"+","+"Y"+","+"\n"
line = str(Company)+','+str(Address)+','+str(x)+','+str(y)+','+'\n' ##line of info for new csv
z+=1
with open("Interm.csv", 'ab') as csvfile: ##creating/opening/closing csv
if z==1:
csvfile.write(firstrow)
else:
csvfile.write(line) ##writing line to csv
print line
fc = arcpy.GetParameterAsText(2)
newpath = arcpy.GetParameterAsText(3)#arcpy.CreateFeatureclass_management(env, fc, arcpy.GetParameterAsText(3),"","","",arcpy.GetParameterAsText(4))
arcpy.AddField_management(newpath, "Company", "TEXT")
arcpy.AddField_management(newpath, "Address", "TEXT")
cursor=arcpy.da.InsertCursor(newpath, ["Company","Address", "SHAPE@XY"])
outcsv = "Interm.csv"
curcsv = gp.SearchCursor(outcsv)
for geom in curcsv:
addr = geom.Address
comp = geom.Company
X = float(geom.X)
Y = float(geom.Y)
newRow = (str(comp),str(addr),(X,Y))
cursor.insertRow(newRow)
print newRow
when i add the script to the toolbox and use arcpy.GetParameterAsText for createfeatureclass tool this is what shows when i set the parameters
then this shows up when I open the script to use
So what i want to do is have the create feature class tool parameters open in my script tool...