Define a Command to Start Your Application (Concept)

AutoCAD

 
Define a Command to Start Your Application
Concept Quick Reference
 
 
 

You can use the acad.pgp file to define a new AutoCAD command that runs an external command to start your application.

You can use the acad.pgp file to define a new AutoCAD command that runs an external command to start your application. The following example defines the RUNAPP1 command, which runs the application app1.exe in the c:\vbapps\ directory. (Add this code to the external commands section of your acad.pgp file.)

RUNAPP1, start c:\vbapps\app1, 0 

If your application requires command line parameters, you can use the following code:

RUNAPP2, start c:\vbapps\app2, 0, *Parameters: ,

This example defines the RUNAPP2 command, which prompts you for parameters and then passes them to your application.

You can also use the AutoLISP startapp function to start an application that makes use of Automation. Once AutoLISP starts the external application, it has no control over its actions. You can, however, use AutoLISP to locate and run different applications based on certain parameters.