The following text is a copy of Python script used to convert CAD data into
shapefiles. The Python file can be found on the CD that accompanies this report.
#This Python script was written to convert the Virginia Base Mapping Project (VBMP)
hydrology tiles from CAD into shapefiles.
#To use, create a new Toolbox in ArcToolbox and add this script to it.
#Open the script in ArcToolbox and following the prompts, choose the workspace
#containing the .DGN files and then choose a different workspace for the output
# Sara Kidd
# Hampton Roads Planning District Commission
# 723 Woodlake Dr
# Chesapeake, VA 23320
# April 2005
from win32com.client import Dispatch
gp = Dispatch("esriGeoprocessing.GpDispatch.1")
# Load required toolboxes...
gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data Management
gp.Workspace = sys.argv
OutWorkspace = sys.argv
seltype = "Polyline"
CAD_Featureclass = "\\Polyline"
CADLayer = "Polyline_Layer"
Filter_Expression = '"Layer" = \'41\''
#Get list of CAD layers
fcs = gp.ListDatasets()
#Reset enumeration so first object is returned