You can run the program using the shellcommandwith the following Command Line parameter switch.

/b

Script name

Designates a script to run after you start the program (b stands for batch process).

If the script file is in the Start In folder, a full path to the script file is required unless this security measure is suppressed either by including the /six command line switch, or setting the LEGACYCODESEARCH system variable to 1.

Scripts can be used to set up drawing parameters in a new drawing file. An SCR file type is assumed.

My control program chooses a dwg file name – then it wants to shell out to autocad and open the passed file name – a dwg file. The user then does the drawing – saves the file and closes autocad – then control is passed back.

In the second setup, my program will supply the dwg name but this time open autocad to edit the passed file name. The user then edits the drawing – saves the file and closes autocad – then control is passed back.

So far so good! I have an exe which opens autocad. This works as expected.

BUT I am unable to open a file etc. The problem is that I do not understand how to create a script file. The /b option when I use fails to open a file. The original exe works as expected using other command line options from other software – eg. i can open pdf files using adobe acrobat from the commad line so I think my code is correct!

It’s just that Autocad doesn’t like my code.

For instance if I want to open a file named DR1527.dwg – what code do I need in the script file? As I understand script files – they are text files that can be created using notepad? The file resides in a folder named CADFiles.