Sometimes users want to capture AutoCAD command line output for parsing into a report. The quick easy way if you don’t have too much content is right clicking the command line area, choosing Copy History and pasting that into an editor to remove the unnecessary parts. However sometimes your content exceeds the history buffer or you just want more control.
AutoCAD LOG controls allow you capture what you want, here are the details.
First, you need to understand where the content goes. AutoCAD allows you to specify the path but you may find the default to be a little deeply nested. To change the path issue the OPTIONS command, under the Files tab you will find a Log File Location branch. Expand that and remember or change the path. It can also be obtained or changed with the LOGFILEPATH command.
Next, understand that AutoCAD automatically assigns the name and you have no total control over it, it’s made up of your drawing name with some additional characters. You can issue LOGFILENAME at the command line to see what the file name will be.
Next, you have control over when AutoCAD writes the content to the file. Most people will want to use the obvious LOGFILEON and LOGFILEOFF commands. If you’re a binary kind of person you can use LOGFILEMODE and 0/1.
So to capture a geometry list you would use this procedure.
- Optionally set the path with the LOGFILEPATH command.
- Turn on the logging with LOGFILEON.
- Issue the LIST command, select objects and complete the list.
- Turn off the logging with LOGFILEOFF.
Then you can drag/drop your .LOG file into your favorite editor which should digest it as plain ASCII text that it is.
A side tip on listing. By default if there is more than one page worth you will need to press enter many times to complete the list. To make the output quicker (and cleaner) issue QAFLAGS at the command prompt and put in a value of 2 to bypass the prompt. When you are done will likely want to set it back to the default value of 0.