On the forums the other day, the question came up “How do I create a desktop icon that launches a specific project?” Today we are going to look at the steps necessary to do that.
We are going to use three key pieces of information. First is that you can create a shortcut for Plant 3D and pass some parameters into it. That’s a fancy way of saying that I can tell the program what to do before I start it. Then we will create a script file with specific commands. Last we will create a shortcut that puts all of the steps together.
Shortcuts and Parameters
The main help file for launching AutoCAD with parameters is here:
The switch we are interested in is the /b which lets you select a script for AutoCAD to load when it starts up.
Create a Script File
Next we need to learn what a script file is. Basically, whenever you do something in AutoCAD you are running a command. I think most of us are aware of the command line and how to use it. For example, when you click on the line button, AutoCAD starts the LINE command and you can see it at the command line. Well, if you take a list of commands you entered and the values you put it, save it as a text file with the .scr extension, you have a script file.
Here is the contents of the script file we will use:
filedia 0 openproject “C:\Users\dave.wolfe.S-VILLE-ECAD\AppData\Roaming\Autodesk\AutoCAD Plant 3D 2013 – English\R19.0\enu\SampleProjects\SampleProject\Project.xml” filedia 1
Note that the script file is all one line and I’ve put quotes around the path.
So we are actually only using two commands, filedia and openproject. The FILEDIA variable tells AutoCAD not to display dialogs when prompting for input. In order to specify a path in our script file, we turn FILEDIA off .
The next command OPENPROJECT is a standard Plant 3D command, we’re used to using it with a dialog though.
At the end we turn FILEDIA back on so user’s are not wondering what happened to their AutoCAD.
Create our ShortCut
The last steps pull everything together.
Right+click on your Plant 3D icon, select Send To, and then Desktop Create Shortcut.
Pull up the properties of your shortcut by right-clicking on it and selecting properties:
Enter /b and put your script path in the Target Path. I got my script path by browsing to my file, doing a Shift+right-click and selecting copy as path.
After you paste the path it should look like this:
You will notice that AutoCAD actually ends up opening two projects, the last project opened, and then it switches to the project specified in the script.
If you have admin privileges, you may be better of running a .reg file like this which sets the current project to a value. Then you can just launch AutoCAD Plant 3D, and it opens it as the last project.
@=”C:\\Users\\dave.wolfe.S-VILLE-ECAD\\AppData\\Roaming\\Autodesk\\AutoCAD Plant 3D 2013 – English\\R19.0\\enu\\SampleProjects\\SampleProject\\Project.xml”
I think in the long run, I’d probably end up using the script method. You could always add a shutdown script to set the project to a small template that opens quickly.
I’d love to hear your thoughts and whether you find this useful.