C:\Temp\PyProcess>python CadtoGeodatabase.py Traceback (most recent call last): File "CadtoGeodatabase.py", line 23, in <module> arcpy.CadToGeodatabase_conversion (input_cad_dataset, out_gdb_path, out_data set_name, reference_scale, spatial_reference) AttributeError: 'module' object has no attribute 'CadToGeodatabase_conversion'
# Name: CadtoGeodatabase.py
# Description: Create a feature dataset
# Author: ESRI
# Import system modules
import arcpy
from arcpy import env
# Set workspace
env.workspace = "C:/Temp/PyProcess"
# Set local variables
input_cad_dataset = "C:/Temp/PyProcess/0028.01.dwg"
out_gdb_path = "C:/Temp/PyProcess/FM.gdb"
out_dataset_name = "_0028_01_dwg"
reference_scale = "1000"
spatial_reference = "NAD_1983_StatePlane_Tennessee_FIPS_4100_Feet"
# Create a FileGDB for the fds
arcpy.CreateFileGDB_management("C:/Temp/PyProcess", "FM.gdb")
# Execute CreateFeaturedataset
arcpy.CadToGeodatabase_conversion (input_cad_dataset, out_gdb_path, out_dataset_name, reference_scale, spatial_reference)
#Name: CADtoGeodatabase.py
# Description: Create a feature dataset
# Author: ESRI
# Import system modules
import arcpy
from arcpy import env
# --- Problem 1 of 3 with original example: missing import for arcpy.conversion (need to include new line below)
# --- Without this statement, execution terminates with the error:
# --- AttributeError: 'module' object has no attribue 'CADToGeodatabase'
import arcpy.conversion
# Set workspace
env.workspace = "C:/data"
# Set local variables
input_cad_dataset = "C:/data/City.DWG"
out_gdb_path = "C:/data/HabitatAnalysis.gdb"
out_dataset_name = "analysisresults"
reference_scale = "1000"
# --- Problem 2 of 3 with original example: spatial_reference generates "Parameters are not valid" execution error
# spatial_reference = "NAD_1983_StatePlane_California_VI_FIPS_0406_Feet"
prjfile = r"C:\Program Files (x86)\ArcGIS\Desktop10.0\Coordinate Systems\Projected Coordinate Systems\State Plane\NAD 1983 (US Feet)/NAD 1983 StatePlane California VI FIPS 0406 (US Feet).prj"
spatial_reference = arcpy.SpatialReference(prjfile);
# Create a FileGDB for the fds
arcpy.CreateFileGDB_management("C:/data", "HabitatAnalysis.gdb")
# Execute CreateFeaturedataset
# --- Problem 3 of 3 with original example: (1) typo in tool name ("Cad" vs. "CAD") and (2) missing SR parameter
# arcpy.CadToGeodatabase_conversion(input_cad_dataset, out_gdb_path, out_dataset_name, reference_scale)
arcpy.CADToGeodatabase_conversion(input_cad_dataset, out_gdb_path, out_dataset_name, reference_scale, spatial_reference)I am getting the same error, what is the cause? There was never really an answer to this issue.