Add AutoLISP to a Custom AutoCAD Command

10 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

Cadalyst Fab Freebies 2021: The editors of Cadalyst, with help from our contributors and readers have updated everyone's favorite guide to software tools and resources that don't cost a cent. "Fabulous Freebies for CAD Users" has something for everyone. Download our guide today!

More News and Resources from Cadalyst Partners

Take the Gradual Path to BIMWhite Paper: Take the Gradual Path to BIM. Implementing building information modeling (BIM) can be a daunting challenge, but you don't have to take on everything at once. Learn how small, incremental advances can yield big benefits over time. Download your paper today!