ESRI to AutoCAD Python Script

The City of Richland’s Public Works converted all its data from AutoCAD to ESRI.  After this was done, the updated information in ESRI was converted back into AutoCAD for our Design group.  We were going to use FME, after some talk with ESRI, we found that they didn’t support this product and we would have to get support from FME itself.  After looking at that option and the option already in ESRI “Export To CAD (Conversion)” we decided to use the latter using python.  The benefit of this was that we already had support from ESRI on their product and would not have to purchase more supports as well as learn a new tool.  FME has a lot of great tools but it would be a deep rabbit hole that we did not have time to explore so we decided to keep it as simple as possible.

After some brainstorming, we decide to create a modular script that used csv files.  This has been a plus because now all we have to do is edit the csv files and there is no need to touch the python scripts.  Since this code is converting Water, Sewer, Storm and Irrigation from an ESRI format to an AutoCAD format we ending up creating 14 python scripts, 13 csv files and four AutoCAD seed drawings.

Python Scripts

All.py, gvar.py, ssblocks.py, sslines.py, sstext.py, wablocks.py, walines.py, watext.py, sdblocks.py, sdlines.py, sdtext.py, irblocks.py, irlines.py, irtext.py

CSV Files

Global.csv, ssblocks.csv, sslines.csv, sstext.csv, wablocks.csv, walines.csv, watext.csv, sdblocks.csv, sdlines.csv, sdtext.csv, irblocks.csv, irlines.csv, irtext.csv

AutoCAD Seed Drawings

Irrigation_Blocks.dwg, Sewer_Blocks.dwg, storm_Blocks.dwg, Water_Blocks.dwg

All the csv files include a process it field and if the field does not have “TRUE” in it the python script will skip it.  Another way to make the code only do certain parts is by commenting out in the All.py script the parts that do not need to be done.

If there are any question about this code, please to do not hesitate to contact me.

Richard Allen

Advertisements

One thought on “ESRI to AutoCAD Python Script

  1. Hello Richard,

    We are looking to also convert our esri data to AutoCAD for our designer but we have little or no experience with Python. Can you provide more details on your process? Examples of your python scripts and .cvs files?

    Thanks,
    Jacque

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s