Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

up vote 3 down vote accepted

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

share|improve this answer
    
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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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