I am making a script which creates a file geodatabase with a feature dataset named "Data". The user inputs the location of where the geodatabse should be created and the name of the geodatabase.
import os, arcpy, time ,sys sr = arcpy.SpatialReference("WGS 1984 UTM Zone 37N") #Create geodatabase out_folder_path = raw_input('Enter location to create file geodatabase :') out_name = raw_input('Enter name of file geodatabase :') GDB = arcpy.CreateFileGDB_management(out_folder_path, out_name) #Create feature datasets out_dataset_path = GDB out_name0 = "Data" fd0 = arcpy.CreateFeatureDataset_management(out_dataset_path, out_name0, sr)
How would one reference this feature dataset created above later on in a script, as an output/input location or to set the env.workspace?
I have tried for example:
arcpy.env.workspace = fd0 points = arcpy.ListFeatureClasses() print points
This yields an error:
RuntimeError: Object: Error in accessing environment
To use as an output location I have tried:
arcpy.ASCII3DToFeatureClass_3d (file,"XYZ", fd0 + "test", "MULTIPOINT", 1,sr,5,"TXT")
This gives the error:
TypeError: unsupported operand type(s) for +: 'Result' and 'str'