Select to view content in your preferred language

Using Scripts (Python) to convert .dwg to .shp

4989
1
04-22-2013 08:55 AM
WinnieLau
Emerging Contributor
I have some .dwg files and I would like to do the following:

1.  Convert .dwg files into .shp
2.  Then extract only the contours from the polyline feature class. 

I would like to using python or scripts to do conversion but I'm not sure how.  Any scripts (python) samples would be great!

Thanks,
Winnie
Tags (2)
1 Reply
RobertBorchert
Honored Contributor
Your over thinking it.

Simply open the dwg in arcgis.  use the selection dialog to select the layer you want from the dwg (contours) then right click and export features and save as a shape file.

IF you have a whole bunch of drawings that have the contour layer you can open them all in autocad at the same time.  if they come in as blocks you can explode them and then do an export and use the query to only export the contours.

Chances are you the dwg will not be clean anyway and there will be some contours in a different layer and there will be some other things in the contours layer.

I have some .dwg files and I would like to do the following:

1.  Convert .dwg files into .shp
2.  Then extract only the contours from the polyline feature class. 

I would like to using python or scripts to do conversion but I'm not sure how.  Any scripts (python) samples would be great!

Thanks,
Winnie
0 Kudos