AnsweredAssumed Answered

Python script that can do a batch import of CAD files into a Geodatabase.

Question asked by iegbulefu on Aug 6, 2012
Latest reply on Aug 21, 2012 by iegbulefu
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 insert a  loop into the script to search through a given folder for all the cardfiles in it and import and classify them under different feature datasets and then store  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)

Outcomes