Skip to main content
deleted 8 characters in body; edited tags; edited title
Source Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

Python script to implement a batch import of CAD files into Geodatabase?

Please doesDoes anyone know where I can get a python script that can do a batch import of CAD files into a Geodatabase.

I have one I wrote here, but it is only able to import one CAD file at a time. It imports the CAD files and splitssplit it into feature classes and stores it in the geodatabase via the feature dataset. It works perfectly well but I need to loop the script to search through a given folder for all the cardfiles in it and import them under different feature datasets and put all the datasets into one geodatabase.

# Name: CadtoGeodatabase.py
# Description: Create a feature dataset
# Author: Irene
# Import system modules
import arcpy
from arcpy import env

# Set workspace
env.workspace = "C:/data1"

# Set local variables
input_cad_dataset = C:\Users\iegbulefu\Documents\info\91036c01.dwg" output_gdb_path = "c:/data/cadfile.gdb"
output_dataset_name = "cadresults"
reference_scale = "1500"
spatial_reference = "Nad_1983_10TM"

# Create a FileGDB for the fds
arcpy.CreateFileGDB_management("C:/data1", "cadfile.gdb")

# Execute CreateFeaturedataset 
arcpy.CreateFileGDB_management("C:/data", "cadfile.gdb")
arcpy.CADToGeodatabase_conversion(input_cad_dataset, output_gdb_path, output_dataset_name, reference_scale)

Python script to implement a batch import of CAD files into Geodatabase

Please does anyone know where I can get a python script that can do a batch import of CAD files into a Geodatabase.

I have one I wrote here, but it is only able to import one CAD file at a time. It imports the CAD files and splits it into feature classes and stores it in the geodatabase via the feature dataset. It works perfectly well but I need to loop the script to search through a given folder for all the cardfiles in it and import them under different feature datasets and put all the datasets into one geodatabase.

# Name: CadtoGeodatabase.py
# Description: Create a feature dataset
# Author: Irene
# Import system modules
import arcpy
from arcpy import env

# Set workspace
env.workspace = "C:/data1"

# Set local variables
input_cad_dataset = C:\Users\iegbulefu\Documents\info\91036c01.dwg" output_gdb_path = "c:/data/cadfile.gdb"
output_dataset_name = "cadresults"
reference_scale = "1500"
spatial_reference = "Nad_1983_10TM"

# Create a FileGDB for the fds
arcpy.CreateFileGDB_management("C:/data1", "cadfile.gdb")

# Execute CreateFeaturedataset 
arcpy.CreateFileGDB_management("C:/data", "cadfile.gdb")
arcpy.CADToGeodatabase_conversion(input_cad_dataset, output_gdb_path, output_dataset_name, reference_scale)

Python script to implement a batch import of CAD files into Geodatabase?

Does anyone know where I can get a python script that can do a batch import of CAD files into a Geodatabase.

I have one I wrote here, but it is only able to import one CAD file at a time. It imports the CAD files and split it into feature classes and stores it in the geodatabase via the feature dataset. It works perfectly well but I need to loop the script to search through a given folder for all the cardfiles in it and import them under different feature datasets and put all the datasets into one geodatabase.

# Name: CadtoGeodatabase.py
# Description: Create a feature dataset
# Author: Irene
# Import system modules
import arcpy
from arcpy import env

# Set workspace
env.workspace = "C:/data1"

# Set local variables
input_cad_dataset = C:\Users\iegbulefu\Documents\info\91036c01.dwg" output_gdb_path = "c:/data/cadfile.gdb"
output_dataset_name = "cadresults"
reference_scale = "1500"
spatial_reference = "Nad_1983_10TM"

# Create a FileGDB for the fds
arcpy.CreateFileGDB_management("C:/data1", "cadfile.gdb")

# Execute CreateFeaturedataset 
arcpy.CreateFileGDB_management("C:/data", "cadfile.gdb")
arcpy.CADToGeodatabase_conversion(input_cad_dataset, output_gdb_path, output_dataset_name, reference_scale)
Tweeted twitter.com/#!/StackGIS/status/232705201474265088
edited tags
Link
Fezter
  • 22k
  • 11
  • 71
  • 126
added code formatting.
Source Link
whuber
  • 70.2k
  • 16
  • 187
  • 282

Heading

Hello everyone, PleasePlease does anyone know where I can get a python script that can do a batch import of CAD files into a Geodatabase.

I have one I wrote here, but it is only able to import one CAD file at a time. It imports the CAD files and splitsplits it into feature classes and stores it in the geodatabase via the feature dataset. It works perfectly well but I need to loop the script to search through a given folder for all the cardfiles in it and import them under different feature datasets and put all the datasets into one geodatabase..

# Name: CadtoGeodatabase.py
# Description: Create a feature dataset
# Author: Irene
# Import system modules
import arcpy
from arcpy import env

# Set workspace
env.workspace = "C:/data1"

# Set local variables
input_cad_dataset = C:\Users\iegbulefu\Documents\info\91036c01.dwg" output_gdb_path = "c:/data/cadfile.gdb"
output_dataset_name = "cadresults"
reference_scale = "1500"
spatial_reference = "Nad_1983_10TM"

# Create a FileGDB for the fds
arcpy.CreateFileGDB_management("C:/data1", "cadfile.gdb")

# Execute CreateFeaturedataset 
arcpy.CreateFileGDB_management("C:/data", "cadfile.gdb")
arcpy.CADToGeodatabase_conversion(input_cad_dataset, output_gdb_path, output_dataset_name, reference_scale)

Heading

Hello everyone, Please does anyone know where I can get a python script that can do a batch import of CAD files into a Geodatabase.

I have one I wrote here, but it is only able to import one CAD file at a time. It imports the CAD files and split it into feature classes and stores it in the geodatabase via the feature dataset. It works perfectly well but I need to loop the script to search through a given folder for all the cardfiles in it and import them under different feature datasets and put all the datasets into one geodatabase..

# Name: CadtoGeodatabase.py
# Description: Create a feature dataset
# Author: Irene
# Import system modules
import arcpy
from arcpy import env

# Set workspace
env.workspace = "C:/data1"

# Set local variables
input_cad_dataset = C:\Users\iegbulefu\Documents\info\91036c01.dwg" output_gdb_path = "c:/data/cadfile.gdb"
output_dataset_name = "cadresults"
reference_scale = "1500"
spatial_reference = "Nad_1983_10TM"

# Create a FileGDB for the fds
arcpy.CreateFileGDB_management("C:/data1", "cadfile.gdb")

# Execute CreateFeaturedataset 
arcpy.CreateFileGDB_management("C:/data", "cadfile.gdb")
arcpy.CADToGeodatabase_conversion(input_cad_dataset, output_gdb_path, output_dataset_name, reference_scale)

Please does anyone know where I can get a python script that can do a batch import of CAD files into a Geodatabase.

I have one I wrote here, but it is only able to import one CAD file at a time. It imports the CAD files and splits it into feature classes and stores it in the geodatabase via the feature dataset. It works perfectly well but I need to loop the script to search through a given folder for all the cardfiles in it and import them under different feature datasets and put all the datasets into one geodatabase.

# Name: CadtoGeodatabase.py
# Description: Create a feature dataset
# Author: Irene
# Import system modules
import arcpy
from arcpy import env

# Set workspace
env.workspace = "C:/data1"

# Set local variables
input_cad_dataset = C:\Users\iegbulefu\Documents\info\91036c01.dwg" output_gdb_path = "c:/data/cadfile.gdb"
output_dataset_name = "cadresults"
reference_scale = "1500"
spatial_reference = "Nad_1983_10TM"

# Create a FileGDB for the fds
arcpy.CreateFileGDB_management("C:/data1", "cadfile.gdb")

# Execute CreateFeaturedataset 
arcpy.CreateFileGDB_management("C:/data", "cadfile.gdb")
arcpy.CADToGeodatabase_conversion(input_cad_dataset, output_gdb_path, output_dataset_name, reference_scale)
Source Link
shade
  • 61
  • 1
  • 2
Loading