Add AutoLISP to a Custom AutoCAD Command

11 Mar, 2014 By: Andrew G. Roe

Combine AutoLISP commands with a VB.NET plugin.

Run the Script and Custom Command

To run the script and custom command, follow these steps:

1. Click the Run Script icon in the Manage tab of the ribbon. (You can also type Script in the Command line, then press Enter.) The Select Script File dialog box is displayed.

2. Navigate to the previously created file and select it.

3. Click Open to run the script.

4. From the Modify menu, select MyCircleCommand2. The command is executed, creating a circle and text as in the previous article and also displaying information on the Command line about the last entity created.

This example provides a simple demonstration of combining AutoLISP commands with a VB.NET plugin. You could expand on this approach by building a more complex AutoLISP routine, saving it in a separate text file, then loading and executing it from the custom command. You can also load an AutoLISP routine prior to executing the command in several different ways. For more information on this, consult the AutoLISP online help guide entry, “About Auto-Loading and Running AutoLISP Routines.”

As you can see, scripts and custom commands can be combined in various ways to meet your needs. In future articles, I'll continue to explore additional facets of AutoCAD programming. If you would like to suggest a topic, feel free to send me an e-mail.

1 2 3 

Add comment

Note: Comments are moderated and will appear live after approval by the site moderator.

AutoCAD Tips!

Lynn Allen

In her easy-to-follow, friendly style, long-time Cadalyst contributing editor Lynn Allen guides you through a new feature or time-saving trick in every episode of her popular AutoCAD Video Tips. Subscribe to the free Cadalyst Video Picks newsletter, and we'll notify you every time a new video tip is published. All exclusively from Cadalyst!

Follow Lynn on TwitterFollow Lynn on Twitter

Do you use any augmented or virtual reality (AR or VR) technologies in your workflow?
Not yet, but we are planning to implement it.
No, but we think these technologies could hold value for us.
No; these technologies do not hold value for us.
Submit Vote

Download Cadalyst Magazine Special Edition