i want to import a python(2.7) script to arcmap 10.1 my script has 2 inputs variables one for workspace and another raster dataset and i want o convert input raster as feature class polygon . i want to create a file geodatabase and import in her a export feature class,run this script and finaly show me complete message(not error)... but created the basis is empty,nowhere feature class.my feature class=Catchment and i want to import in gdb(my file geodatabase) but if i run this script show me complete message but the gdb(my file geodatabase) is empty

import arcpy
import sys
import os
from arcpy import env as e
from arcpy.sa import *
arcpy.ImportToolbox("C:\Program Files (x86)\ArcGIS\Desktop10.1\ArcToolbox\Toolboxes\Arc Hydro Tools.tbx", "archydrotools")
 e.workspace = arcpy.GetParameterAsText(0) # import workspace
 Cat = arcpy.GetParameterAsText(1)         # import raster dataset
 ws = e.workspace
 gdb = "teleia"                            # import name of geodatabase
 # Local variables:
 arcpy.env.overwriteOutput = True
 out = ws + os.sep + gdb + os.sep
 # Process: Catchment Polygon Processing
 arcpy.CatchmentPolyProcessing_archydrotools(Cat, Catchment)
 Catchment =out + "Catchment"

any idea ?

closed as unclear what you're asking by PolyGeo, Chad Cooper, Fezter, Jason Scheirer, Simbamangu Mar 27 '14 at 8:14

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    There seems to be a lot of extra code in your script than what you need to accomplish according to the text of your stated aim in your Question. Consequently, I recommend that you try to create a (largely) working snippet of Python code so that what you are asking becomes clearer. To do this I think you should start with a new *.py and just copy into it the parts you need to "create a file geodatabase and import in her a export feature class". Once you get this working then, and only then, would I advise starting to complicate it with additional code. – PolyGeo Mar 26 '14 at 3:29
  • i edit my question – hellas Mar 26 '14 at 9:12
  • try with the ".gdb" extension on you gdb name – radouxju Mar 26 '14 at 20:21
  • gdb = "teleia" + ".gdb" that is a right ? – hellas Mar 26 '14 at 20:22
  • thanx that right – hellas Mar 26 '14 at 20:42

Still difficult to interpret your question but untested code below may help.

import arcpy
import os
arcpy.CheckOutExtension("spatial") # only required if CatchmentPolyProcessing requires it
arcpy.env.overwriteOutput = True
arcpy.ImportToolbox(r"C:\Program Files (x86)\ArcGIS\Desktop10.1\ArcToolbox\Toolboxes\Arc Hydro Tools.tbx", "archydrotools")

    ws = arcpy.GetParameterAsText(0)      # workspace
    rasCat = arcpy.GetParameterAsText(1)  # raster dataset
    gdb = "teleia"                        # geodatabase name
    catchment = "Catchment"

    outGDB = os.path.join(ws,gdb)

    # Process: Catchment Polygon Processing
    polyCat = os.path.join(outGDB, catchment)
    arcpy.AddMessage('CatchmentPolyProcessing inputs = \n\t%s\n\t%s' %(rasCat, polyCat))
    arcpy.CatchmentPolyProcessing_archydrotools(rasCat, polyCat)
  • look cat is a raster dataset and i want to convert to polygon and import that convert in file geodatabase. 1. step create a file geodatabase 2.step convert raster to polygon 3.step import that polygon in to file geodatabase my proplem is can not to import that polygon feature class in file geodatabase,after the run file gedatabase is still empty... and your code has same problem after the run your code file geodatabase is empty – hellas Mar 26 '14 at 17:32

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