Taking control of your command line history

Thanks to Kean Walmsley’s post on his Through the Interface blog, I have learned something that would have been handy to know for the last decade or so, but which somehow escaped my knowledge. I learned how to increase the size of AutoCAD’s command line history cache. It defaults to 400 lines, which isn’t enough for me. I think this information deserves a wider audience than the ubergeek developers who frequent Kean’s blog, so here goes.

Although it’s not directly mentioned on Kean’s post, you can find the current command line history cache length setting like this:

(getenv "CmdHistLines")

This will return a value showing the number of command lines AutoCAD remembers, e.g. “400”. Although this is used as an integer value, it is passed to and from the Registry as a string. You can set a new value as shown below. Again, use a string, and note that values outside the range 25 to 2048 will be ignored:

(setenv "CmdHistLines" "2048")

Also, if you don’t like AutoCAD repeatedly stopping during a long listing (e.g. SETVAR ? *), you can turn off that feature by setting the QAFLAGS system variable to 2. Don’t set it to 8191 as suggested in Kean’s post, because that will change a lot of other settings, few of which are documented publicly.

9 comments to Taking control of your command line history

  • I know you are aware of this Steve, but maybe to help others…?

    If things start going haywire for you after you mess with QAFLAGS, set it back to 0 and try again. I frequently keep mine set to 3 and equal as frequently forget about this setting when strange things start happening…

    Here is a list of some of the things I’ve experienced/compiled from others..

    http://cadpanacea.com/node/266

  • Edit: this comment is a reply to a non-obvious spam comment, now removed; cadlearning blogspot is now on my permanent brownlist. However, the following information is useful, so I’ll leave it in.

    Both CmdHistLines and QAFLAGS will work on all recent AutoCAD releases. I’ve tested CmdHistLines back to 2004, but I suspect it works back to Release 14. QAFLAGS 2 works all the way back to Release 12. AutoCAD 2007 shouldn’t be a problem.

  • (getenv “CmdHistLines”) (setenv “CmdHistLines” “2048”)

    These comments are new to me. :) Thank you.

    Oops one more there “QAFLAGS”. Thanks R.K.

  • Andre

    I am trying to list all variables and be able to scroll-up to first on the list.
    Tried to Regedit cmdhistlines and it is nowhere to be found, and tried at command line with (setenv “CmdHistLines” “2048”).

    None of them worked.

    Anyone with the same issue in CAd 2012?
    Thanks

  • Vusal Jalilov

    getenv Unknown command “GETENV”. Press F1 for help.

Leave a Reply

 

 

 

Polls

Autodesk orphans, how well were you looked after?

View Results

Loading ... Loading ...

How good is Autodesk's customer focus?

View Results

Loading ... Loading ...

How good is Autodesk at the Internet?

View Results

Loading ... Loading ...

What is your relationship to Autodesk?

View Results

Loading ... Loading ...

Blog Statistics

  • Total Stats
    • 491 Posts
    • 551 Tags
    • 3,409 Comments
    • 1,101 Comment Posters
    • 69 Post Categories