ERROR 000732: Input CAD Datasets: Dataset 100135S01.dwg does not exist or is not supp

1910
2
Jump to solution
09-18-2012 07:54 AM
IreneEgbulefu
New Contributor II
Please can someone help me out with is error?
I have created a script to list all my CAD files in the directory and subdirectories and then convert them to Geodatabase with feature classes. When I run the script, it creates an empty geodatabase and list just the first file and gives the error"

"ERROR 000732: Input CAD Datasets: Dataset 100135S01.dwg does not exist or is not supported, Failed to execute (CADToGeodatabase)..


What could be the issue here?. Please help!

Thanks

Here is my script

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)
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
ArkadiuszMatoszka
Occasional Contributor II
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

View solution in original post

0 Kudos
2 Replies
ArkadiuszMatoszka
Occasional Contributor II
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
0 Kudos
IreneEgbulefu
New Contributor II
Oooh Arkadiusz! Thank you very very much for this great input. I made the modification and my script is running perfectly well.

So for anyone who might be interested! this is what my script is built to do. Scans through the specified drive for all autoCAD files with .dwg extension, list them out; creates a geodatabase with the name '2010.gdb, then converts all the .dwg files into feature dataset with feature classes and store in the geodatabase created.

The correct script is shown below

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