2

I have a simple python script that works when run from PythonWin, but when I try to make it dynamic to run inside ArcMap I keep receiving: : ERROR 999999: Error executing function. Failed to execute (CreateFeatureclass). It must be something I am doing when setting the parameters from the script properties from within ArcMap. I've created scripts with user input before, so for the life of me I can't figure out why it won't work.

import arcpy
import os

arcpy.env.overwriteOutput = True

path = arcpy.GetParameterAsText(0)
name = arcpy.GetParameterAsText(1)
type = "POINT"

m = "DISABLED"
z = "DISABLED"
prjFile = "C:/Program Files/ArcGIS/Desktop10.0/Coordinate Systems/Projected Coordinate Systems" + \
          "/State Plane/NAD 1983 (US Feet)/NAD 1983 StatePlane North Carolina FIPS 3200 (US Feet).prj"
reference = arcpy.SpatialReference(prjFile)

arcpy.CreateFeatureclass_management(path, name, type, "", m, z, reference)

When creating the parameters I have the first input as follows: Data Type = workspace or feature dataset type = required direction = Input Environment = workspace

The second input is: Data Type = Featureclass....I've also tried Shapefile as well Type = Required Direction = Output

0
3

According to the ArcGIS 10.0 help for Create Feature Class (Data Management), specifying the first input parameter as a workspace or FDS is correct. However, you have to specify "String" for the second parameter, rather than "featureclass" or "shapefile". Also, try changing the direction in the second parameter to "Input".

enter image description here

1
  • Thanks. I had consulted the help for that tool and had not paid enough attention to the data type being a string for the out_name. Thanks again. – KFP Jan 28 '13 at 17:58

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.