Launching External Programs and CADpilot
by Mark Stefanchuk, CADmanage.com
Yesterday I was looking at launching external applications from my favorite CAD programs. Launching standard Windows office applications are generally supported, but I wanted to see if I could launch an executable developed by someone other than Microsoft. Sure enough, there are several posts out there that document how to do this, but I thought it might be helpful to see how to handle it in both MicroStation and AutoCAD. And many of our CADpilot customers have asked the same thing, specifically “how do I launch an external application using CADpilot?” So, I’ve included a couple of CADpilot examples too.
In MicroStation this is easy. Use the “%” symbol before the application name. For example,
As long as snagit32.exe is found in a PATH folder the program will launch. If it’s not in the path then you can always be explicit. For example,
%"C:\Program Files (x86)\SDJElectra\SegmentTables\Program\segmenttables.exe"
The quotes are necessary because there are spaces in the path spec.
In AutoCAD it takes a little more effort, but you can do it. The START command will launch most windows programs found in PATH. If it’s not found in path you will need to use the SHELL command. For example,
SHELL "C:\Program Files (x86)\SDJElectra\SegmentTables\Program\segmenttables.exe"
These will start a command window which then executes the request.
You can also set up an alias by editing the acad.pgp file. To open this file in Civil3d go to the Manage tab on the ribbon menu and click “Edit Aliases”. This will open the file in notepad. You can find more information on how to add aliases for external programs from the knowledgebase article, Starting Windows programs from the AutoCAD command line.
The interesting thing about the alias file is that it is user specific. If you do a Save-As from notepad you will see that the acad.pgp file is located in the users AppData folder. It will move with the user’s roaming profile, but everyone could have a different acad.pgp.
That’s great. It gives your users control over their personal CAD environment. On the other hand, you will have to do some planning if you, as the CAD Manager, make changes to this file and want to deploy it to everyone on the team.
A somewhat biased plug – this is one of the many reasons I like CADpilot. The user can create her own aliases and you can deliver program launch commands for the whole team, or for segments of your team to a single location. Also, since CADpilot is a delivery and deployment platform you can make global changes very easily without making users exit their design session.
Ok, so for those of you already using CADpilot, launching commands is really easy. You use the “cadpilot ui run” command. In MicroStation it will look like this,
cadpilot ui run snagit32
and for AutoCAD,
If you need to spec the whole path then use the following format.
(cadpilot-ui-run "C:/Program Files (x86)/SDJElectra/SegmentTables/Program/segmenttables.exe")
In the editor it would look like this.
On my development menu I’ve just added it as a test – like this,
It looks the same in both MicroStation and AutoCAD, there’s no DOS command shell opened when the command launches, and I only had to deploy it to one location.
I also discovered, today, that I can add my own variables to cadpilot.ui.cfg file. I added,
MYPATHVAR = C:/mydevpath/
The new commands for MicroStation and AutoCAD,
You don’t have to exit the CAD application either, just reload the menu.
If you’re not already a CADpilot user, download the demo version from cadmanage.com.
About Mark Stefanchuk: Mark is a VP and senior consultant with CAD Management Resources, Inc. He divides his time between developing innovative custom software solutions and helping clients navigate complex design automation environments. If you would like to find out how he can assist you with your design technology he can be reached by contacting us at email@example.com.