Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running AutoCAD from command line only

I would like to run an AutoCAD script, print the resulting drawing to PDF and exit AutoCAD, all without a single click (so we can schedule it on a server). Is that possible with AutoCAD?

like image 331
dijxtra Avatar asked Sep 20 '25 23:09

dijxtra


2 Answers

Yes, use the /b command line parameter

Command Line Switch Reference

/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.

If you want AutoCAD to exit after completing the script, you will need to include that as part of the script as well.

like image 151
crashmstr Avatar answered Sep 23 '25 12:09

crashmstr


If you're simply scripting Autocad tasks, you should use AutoDesk's accoreconsole.exe. You can find this console app in the same folder as your acad.exe. It has (almost) all the same libraries as Autocad, but it is super light weight because there is no UI -> therefore VERY FAST. I use accoreconsole for all of my company's drawing processing needs, and it is fantastic!

This will get you started: http://adndevblog.typepad.com/autocad/2012/04/getting-started-with-accoreconsole.html

Let me know if you have any more specific questions once you've had time to look at it.

like image 34
Nik Avatar answered Sep 23 '25 12:09

Nik