"ERROR 000732: Input CAD Datasets: Dataset 100135S01.dwg does not exist or is not supported, Failed to execute (CADToGeodatabase)..
import os, os.path, arcpy from arcpy import env env.workspace = "J:/2010" # Set workspace and variables gdb = r"C:\data\2010.gdb" arcpy.env.workspace = gdb # Create a FileGDB for the fds arcpy.CreateFileGDB_management("C:/data", "2010.gdb") reference_scale = "1500" for root, dirs, files in os.walk("J:/2010/"): for file in files: if file.endswith('.dwg'): print "current file is: " + file outDS = arcpy.ValidateTableName(os.path.splitext("d" + os.path.basename(file))[0]) arcpy.CADToGeodatabase_conversion(file, gdb, outDS, reference_scale)
Solved! Go to Solution.
arcpy.CADToGeodatabase_conversion(root + '\\' + file, gdb, outDS, reference_scale)
arcpy.CADToGeodatabase_conversion(root + '\\' + file, gdb, outDS, reference_scale)
import os, os.path, arcpy from arcpy import env env.workspace = "J:/2010" # Set workspace and variables gdb = r"C:\data\2010.gdb" arcpy.env.workspace = gdb # Create a FileGDB for the fds arcpy.CreateFileGDB_management("C:/data", "2010.gdb") reference_scale = "1500" for root, dirs, files in os.walk("J:/2010/"): for file in files: if file.endswith('.dwg'): print "current file is: " + file outDS = arcpy.ValidateTableName(os.path.splitext("d" + os.path.basename(file))[0]) arcpy.CADToGeodatabase_conversion(root + '\\' + file, gdb, outDS, reference_scale)
Hi,
I think changing last line to:arcpy.CADToGeodatabase_conversion(root + '\\' + file, gdb, outDS, reference_scale)
Should help, now you look all files in 'J:\\2010\\' (or J:/2010/ if you prefer)
BR,
Arek