Summary
Creates a file geodatabase in a folder.
Usage
The output path must already exist.
If the output geodatabase name does not include a .gdb extension, one will be added.
Syntax
CreateFileGDB_management (out_folder_path, out_name, {out_version})
Parameter | Explanation | Data Type |
out_folder_path | The folder where the file geodatabase will be created. | Folder |
out_name | The name of the file geodatabase to be created. | String |
out_version (Optional) | The ArcGIS version for the new geodatabase.
| String |
Code sample
CreateFileGDB example 1 (Python window)
The following Python window script demonstrates how to use the CreateFileGDB function in immediate mode.
import arcpy
arcpy.CreateFileGDB_management("C:/output", "fGDB.gdb")
CreateFileGDB example 2 (Python window)
The following Python window script demonstrates how to use the CreateFileGDB function in immediate mode to create a file geodatabase corresponding to a previous release of ArcGIS.
import arcpy
arcpy.CreateFileGDB_management("C:/output", "fGDB.gdb", "9.2")
CreateFileGDB Example 3 (Stand-alone Python Script)
The following Python script demonstrates how to use the CreateFileGDB function in a stand-alone script.
# Name: CreateFileGDB_Example2.py
# Description: Create a file GDB
# Import system modules
import arcpy
# Set local variables
out_folder_path = "C:/output"
out_name = "fGDB.gdb"
# Execute CreateFileGDB
arcpy.CreateFileGDB_management(out_folder_path, out_name)
Environments
Licensing information
- ArcGIS Desktop Basic: Yes
- ArcGIS Desktop Standard: Yes
- ArcGIS Desktop Advanced: Yes