Friday, January 15, 2010

The BEST scripting tool for AutoCAD

WARNING: the following posts may contain graphic representations of actual mathematics.  Also if you don't use (or care to use) AutoCAD, Excel, or Notepad++ you may want to skip the next few posts.  Don't worry; I'll return to the topic of cycling very soon.

Scripts are a great way to automate many processes in AutoCAD.  They are simple.  If you use the command line you can use a script.  They are easy to create, just open a text editor like notepad++.  They are easy to run.  You can open them like any other document, or you can incorporate them into the CUI or tool palettes.

Of course, you must be very careful, you have to dot all your “i”s and cross all your “t”s.  You must have the exact number of spaces located in the right places.  Because of the time it takes you’ll want to re-use your script as many times as possible.  But there isn’t much flexibility.  Once you’re done with the main script you may want to change it slightly, or apply it to a bunch of files.  Is it possible to automate the process of creating automations?

There are a variety of tools out there specifically designed for applying scripts to multiple files and editing scripts.  But the handiest tool I’ve found is almost ubiquitous.  It is simply a spreadsheet program.  Excel, Open Office, even Google Docs can be used to make the task of scripting easier.
Over the course of the next few posts, I’ll show you some of my processes for using Excel to write scripts.  I’ll conclude with excel scripts designed to help with layer management.

But first, I have to give props to Mark Johnson of the SF AutoCAD Users group for turning me on to this one.  I’d just gotten into creating scripts in a text editor when he led a discussion on using Excel. It was an eye opening experience.  One script he showed us generated structural shapes based on calculations derived in excel.  Another took image data from a couple of photographs and mapped points in 3D.

I’ve never done anything as intense as he showed, but I’ve heavily integrated the tools into my daily work.

No comments:

Post a Comment