Monday, January 18, 2010

First things first – Creating a basic script

As I mentioned previously, a script is simply a list of commands executed sequentially.  All you have to do in Excel is create a list of commands.  Then you can paste these commands into the command line of AutoCAD and they will execute.

Here’s an example of a script that creates a simple rectangle:
Rec
0,0
1,1

To test it out, you can copy the text and paste it into the command line.

A quick reminder here, you need to be aware of how many spaces and returns are included when you run scripts.  Too few and your last command won't be concluded (just hit enter in ACAD) too many and you'll start another command (just hit ESC).

Pretty simple, no?

Here is the same rectangle in a table
Rec
0,0
2,2


Test this one as well.   Copy and paste into the command line.



That’s the basic idea. 

Now, it might not look like much, but now that you are working in Excel, you can use all the tools that come along with Excel.  You can use functions and references to move your data around or change it however you like.

No comments:

Post a Comment