Author Topic: Reissue Challenge: Get all system variables with values  (Read 13044 times)

0 Members and 1 Guest are viewing this topic.

pkohut

  • Guest
Reissue Challenge: Get all system variables with values
« on: March 10, 2010, 06:18:55 AM »
From a long long time ago -
I don't know how one would accomplish this, and thought it might be fun.  I will look into this a little more when I get back from lunch.

Since this challenge was never completed I thought it would be cool to reissue it. http://www.theswamp.org/index.php?topic=12882.msg157207#msg157207

As an alternative to the brute force method that was originally tried, how about mining strings from the executable? You can get a program to do just that from Microsoft Technet http://technet.microsoft.com/en-us/sysinternals/bb897439.aspx.  Generate a working dataset of strings from the Windows command line by issuing the following commands -
Code: [Select]
strings -u -n1 acad.exe > StringsU.txt
strings -a -n1 acad.exe > StringsA.txt
Then process the dataset using your favorite programming language to find the strings that can be used with GETVAR.

The dataset will be huge, so the challenge then becomes how to effectivly work with the generated data, reducing runtime.


MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Reissue Challenge: Get all system variables with values
« Reply #1 on: March 10, 2010, 06:40:34 AM »
Generate a working dataset of strings from the Windows command line by issuing the following commands -
Code: [Select]
strings -u [color=red]-n1[/color] acad.exe > StringsU.txt
strings -a [color=red]-n1[/color] acad.exe > StringsA.txt

Then process the dataset using your favorite programming language to find the strings that can be used with GETVAR.

tiny fix:

Code: [Select]
strings -u[color=red] -n 1[/color] acad.exe > StringsU.txt
strings -a [color=red]-n 1[/color] acad.exe > StringsA.txt

edit: having look at the spawned data, strings sorted and unique, the unicode file while smaller appears to have much more promise than the ascii file

could be wrong tho, i'm enjoying a sleepless night so i'm kinda crossed eyed  :doa:
« Last Edit: March 10, 2010, 06:54:36 AM by MP »
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8661
  • AKA Daniel
Re: Reissue Challenge: Get all system variables with values
« Reply #2 on: March 10, 2010, 07:11:47 AM »
here is from acad 2006

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Reissue Challenge: Get all system variables with values
« Reply #3 on: March 10, 2010, 07:16:52 AM »
2008 attached.

Simple test: Open the files and search for "ltscale" or "viewmode" etc. It suggests _StringsU.txt will be the one that is the most revealing.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

pkohut

  • Guest
Re: Reissue Challenge: Get all system variables with values
« Reply #4 on: March 10, 2010, 07:19:16 AM »
here is from acad 2006

How long did it take to generate?

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8661
  • AKA Daniel
Re: Reissue Challenge: Get all system variables with values
« Reply #5 on: March 10, 2010, 07:20:22 AM »
about a second

here is acad 07

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8661
  • AKA Daniel
Re: Reissue Challenge: Get all system variables with values
« Reply #6 on: March 10, 2010, 07:21:04 AM »
Code: [Select]
static void ArxGetVar_doit(void)
  {
    std::wstring temp;
    std::vector<std::wstring> strings;
    std::wifstream ifs( _T("c:\\StringsU.txt") );
    std::wofstream ofs( _T("c:\\StringsUOut.txt") );

    while( getline( ifs, temp ) )
      strings.push_back(temp);

    resbuf buf;
    for(size_t i=0;i<strings.size();i++)
    {
      if(acedGetVar(strings[i].c_str(),&buf) == RTNORM)
      {
        ofs << strings[i] << std::endl;
      }
    }
    ofs.close();
    ifs.close();
  }
« Last Edit: March 10, 2010, 07:25:47 AM by Daniel »

pkohut

  • Guest
Re: Reissue Challenge: Get all system variables with values
« Reply #7 on: March 10, 2010, 07:26:24 AM »
2008 attached.

Simple test: Open the files and search for "ltscale" or "viewmode" etc. It suggests _StringsU.txt will be the one that is the most revealing.

I think your right.  Also look if someone is to parse the list then the strings starting with the * character will need to strip the * before testing.  Just saw Daniels results.  Nice.

pkohut

  • Guest
Re: Reissue Challenge: Get all system variables with values
« Reply #8 on: March 10, 2010, 07:31:16 AM »
Code: [Select]
static void ArxGetVar_doit(void)
  {
    std::wstring temp;
    std::vector<std::wstring> strings;
    std::wifstream ifs( _T("c:\\StringsU.txt") );
    std::wofstream ofs( _T("c:\\StringsUOut.txt") );

How about using std::set instead?  That should reduce the dataset quite a bit.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8661
  • AKA Daniel
Re: Reissue Challenge: Get all system variables with values
« Reply #9 on: March 10, 2010, 07:45:48 AM »
Code: [Select]
static void ArxGetVar_doit(void)
  {
    std::wstring temp;
    std::vector<std::wstring> strings;
    std::wifstream ifs( _T("c:\\StringsU.txt") );
    std::wofstream ofs( _T("c:\\StringsUOut.txt") );
How about using std::set instead?  That should reduce the dataset quite a bit.

like this?
Code: [Select]
  typedef std::set<std::wstring> stringset;
  static void ArxGetVar_doit(void)
  {
    std::wstring temp;
    stringset strings;
    stringset::iterator iter;
    std::wifstream ifs( _T("c:\\StringsU.txt") );
    std::wofstream ofs( _T("c:\\StringsUOut.txt") );

    while( getline( ifs, temp ) )
      strings.insert(temp);

    resbuf buf;
    for(iter = strings.begin();iter!=strings.end();++iter)
    {
      if(iter->size() > 0 )
      {
        if(iter->at(0) != '*')
        {
          if(acedGetVar(iter->c_str(),&buf) == RTNORM)
          {
            ofs << *iter << std::endl;
            if(buf.restype == RTSTR)
              free(buf.resval.rstring);
          }
        }
      }
    }
    ofs.close();
    ifs.close();
  }

« Last Edit: March 10, 2010, 07:55:04 AM by Daniel »

pkohut

  • Guest
Re: Reissue Challenge: Get all system variables with values
« Reply #10 on: March 10, 2010, 07:56:49 AM »
Code: [Select]
static void ArxGetVar_doit(void)
  {
    std::wstring temp;
    [color=brown]std::vector<std::wstring> strings;[/color]
    std::wifstream ifs( _T("c:\\StringsU.txt") );
    std::wofstream ofs( _T("c:\\StringsUOut.txt") );
How about using std::set instead?  That should reduce the dataset quite a bit.

std::set<std::wstring> strings;

and this to get rid of duplicates (untested) -
   while( getline( ifs, temp ) )
      strings.insert(std::transform(temp.begin(), temp.end(), temp.begin(), std::toupper);


It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8661
  • AKA Daniel
Re: Reissue Challenge: Get all system variables with values
« Reply #11 on: March 10, 2010, 08:08:40 AM »
edit: updated with Paul's mods  :kewl:
Code: [Select]
 typedef std::set<std::wstring> stringset;
  static void ArxGetVar_doit(void)
  {
    std::wstring temp;
    stringset strings;
    std::wifstream ifs( _T("c:\\StringsU.txt") );
    std::wofstream ofs( _T("c:\\StringsUOut.txt") );

    while( getline( ifs, temp ) )
    {
      std::transform(temp.begin(), temp.end(), temp.begin(), std::toupper);
      if(temp[0] == '*')
        strings.insert(temp.substr(1));
      else
        strings.insert(temp);
    }

    resbuf buf;
    for(stringset::iterator iter = strings.begin();iter!=strings.end();++iter)
    {
      if(acedGetVar(iter->c_str(),&buf) == RTNORM)
      {
        ofs << *iter << std::endl;
        if(buf.restype == RTSTR)
          free(buf.resval.rstring);
      }
    }
    ofs.close();
    ifs.close();
  }

07 output
« Last Edit: March 10, 2010, 09:08:22 AM by Daniel »

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8661
  • AKA Daniel
Re: Reissue Challenge: Get all system variables with values
« Reply #12 on: March 10, 2010, 08:23:02 AM »
here is 2010s list
« Last Edit: March 10, 2010, 09:07:07 AM by Daniel »

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8661
  • AKA Daniel
Re: Reissue Challenge: Get all system variables with values
« Reply #13 on: March 10, 2010, 08:26:46 AM »
Anyway, pretty cool find Paul

pkohut

  • Guest
Re: Reissue Challenge: Get all system variables with values
« Reply #14 on: March 10, 2010, 08:32:42 AM »
Here's a couple tweeks to your code.  Gets rid of duplicates by promoting all strings to upper case, then adding them to a std::set.  Also, ignores the first character of a string if it is *

Code: [Select]
#include <set>
#include <fstream>
#include <string>
#include <cctype>


    static void ArxGetVar_doit(void)
    {
        std::wstring temp;
        std::set<std::wstring> strings;
        std::wifstream ifs( _T("c:\\StringsU.txt") );
        std::wofstream ofs( _T("c:\\StringsUOut.txt") );

        while( getline( ifs, temp ) ) {
            std::transform(temp.begin(), temp.end(), temp.begin(), std::toupper);
            if(temp[0] == L'*')
                strings.insert(temp.substr(1));
            else
                strings.insert(temp);
        }

        resbuf buf;
        for(std::set<std::wstring>::iterator it = strings.begin(); it != strings.end(); it++)
        {
            if(acedGetVar(it->c_str(),&buf) == RTNORM)
            {
                ofs << it->c_str() << std::endl;
            }
        }
        ofs.close();
        ifs.close();
    }

} ;

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8661
  • AKA Daniel
Re: Reissue Challenge: Get all system variables with values
« Reply #15 on: March 10, 2010, 08:36:44 AM »
nice!
don't forget this

Code: [Select]
if(buf.restype == RTSTR)
  free(buf.resval.rstring);


T.Willey

  • Needs a day job
  • Posts: 5251
Re: Reissue Challenge: Get all system variables with values
« Reply #16 on: March 10, 2010, 11:17:47 AM »
Thanks for finding a way to do this Paul!  It really bothered me that I couldn't find a way to make it work.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

pkohut

  • Guest
Re: Reissue Challenge: Get all system variables with values
« Reply #17 on: March 10, 2010, 01:42:11 PM »
Thanks for finding a way to do this Paul!  It really bothered me that I couldn't find a way to make it work.

You guys were on the right path, just need to narrow the workload a bit.  8-)

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Reissue Challenge: Get all system variables with values
« Reply #18 on: March 10, 2010, 02:25:40 PM »
'09 Electrical versions

With Lisp.
Ascii : 3.953 seconds
Unicode : 0.328 seconds
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Re: Reissue Challenge: Get all system variables with values
« Reply #19 on: March 10, 2010, 02:29:52 PM »
Tim,

I'm a bit lost in with all the 'higher knowledge' of this thread, but just curious, how can this:

Code: [Select]
strings -u -n1 acad.exe > StringsU.txt
strings -a -n1 acad.exe > StringsA.txt

be applied with LISP? [ Assuming you went down that route ]

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Re: Reissue Challenge: Get all system variables with values
« Reply #20 on: March 10, 2010, 02:44:19 PM »
What are the results you guys are getting after a parse of these strings?  ...the reason i ask is because i could have sworn that ive done this; let me look.
***
I had a list of `known' vars and i compared that to my `string' list i read from the mep 05 acad.exe whereupon i came up with the DATA file in this post: http://www.theswamp.org/index.php?topic=14632.0
With a var on its own line, i had about 700.

When i get some time i want to try and find some of the code i used to generate (compare files and such) that dat file and study this post more because im still a bit confused.

EDIT: Just saw Tim's post....
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Reissue Challenge: Get all system variables with values
« Reply #21 on: March 10, 2010, 03:17:44 PM »
Tim,

I'm a bit lost in with all the 'higher knowledge' of this thread, but just curious, how can this:

Code: [Select]
strings -u -n1 acad.exe > StringsU.txt
strings -a -n1 acad.exe > StringsA.txt

be applied with LISP? [ Assuming you went down that route ]

I didn't Lee.  I use Lisp to evaluate what was returned by that.  I didn't want to take the time to figure out how to call the command through lisp, I just processed what it returned.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Re: Reissue Challenge: Get all system variables with values
« Reply #22 on: March 10, 2010, 05:09:44 PM »
Tim,

I'm a bit lost in with all the 'higher knowledge' of this thread, but just curious, how can this:

Code: [Select]
strings -u -n1 acad.exe > StringsU.txt
strings -a -n1 acad.exe > StringsA.txt

be applied with LISP? [ Assuming you went down that route ]

I didn't Lee.  I use Lisp to evaluate what was returned by that.  I didn't want to take the time to figure out how to call the command through lisp, I just processed what it returned.

Ah, I see thanks buddy  :-)

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8661
  • AKA Daniel
Re: Reissue Challenge: Get all system variables with values
« Reply #23 on: March 11, 2010, 12:04:28 AM »
So did anyone catch any strange undocumented sysvars?  :-)

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Reissue Challenge: Get all system variables with values
« Reply #24 on: March 11, 2010, 12:52:31 AM »
So did anyone catch any strange undocumented sysvars?  :-)

 :|
Does anyone have a list of the documented ones ?  :lol:
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8661
  • AKA Daniel
Re: Reissue Challenge: Get all system variables with values
« Reply #25 on: March 11, 2010, 01:05:42 AM »
So did anyone catch any strange undocumented sysvars?  :-)

 :|
Does anyone have a list of the documented ones ?  :lol:

good point  :-o

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Re: Reissue Challenge: Get all system variables with values
« Reply #27 on: March 11, 2010, 10:06:34 AM »
I believe Kerry was just making a facetious remark.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Re: Reissue Challenge: Get all system variables with values
« Reply #28 on: March 11, 2010, 10:10:00 AM »
I believe Kerry was just making a facetious remark.

No flies on you John  :wink:

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Re: Reissue Challenge: Get all system variables with values
« Reply #29 on: March 11, 2010, 10:17:42 AM »
* Se7en confused.
I'm taking advantage of a situation?


I'm not trying to be difficult here i truly dont understand.



EDIT:
*shock!* we can use the " / me " tag?!?!?!
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Reissue Challenge: Get all system variables with values
« Reply #30 on: March 11, 2010, 09:27:10 PM »
< .. >

EDIT:
*shock!* we can use the " / me " tag?!?!?!


That should be great for the next time you change your name John.

//--

What are you confused about today Sir ??
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Re: Reissue Challenge: Get all system variables with values
« Reply #31 on: March 11, 2010, 09:40:46 PM »
ha-ha-ha You find that me changing my name every two weeks is anoying too? I was thinkng of starting a spread sheet.

slash-me is an Old 'IRC' thing (I'm easily amused).

I was confused at what Lee Mac said; and how I had no flies on me. I thought that ment that i was taking advantage of a situation...But i could Be wrong as usual.
« Last Edit: March 11, 2010, 09:47:51 PM by Se7en »
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Reissue Challenge: Get all system variables with values
« Reply #32 on: March 11, 2010, 09:58:15 PM »
I was confused at what Lee Mac said; and how I had no flies on me. I thought that ment that i was taking advantage of a situation...But i could Be wrong as usual.
Nah, I think he was just commenting on how much he enjoys your cleanliness.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Re: Reissue Challenge: Get all system variables with values
« Reply #33 on: March 11, 2010, 10:07:12 PM »
*lol* ...I do tend to bath quite regularly.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

pkohut

  • Guest
Re: Reissue Challenge: Get all system variables with values
« Reply #34 on: March 11, 2010, 10:15:47 PM »
*lol* ...I do tend to bath quite regularly.

We appreciate that.  Any less regularly could be a problem though.  ;-)

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Reissue Challenge: Get all system variables with values
« Reply #35 on: March 11, 2010, 10:18:09 PM »
*lol* ...I do tend to bath quite regularly.

We appreciate that.  Any less regularly could be a problem though.  ;-)
Big Brother monitoring bathing habits now?
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Reissue Challenge: Get all system variables with values
« Reply #36 on: March 12, 2010, 12:04:57 AM »
<  .. >
I was confused at what Lee Mac said; and how I had no flies on me. I thought that ment that i was taking advantage of a situation...But i could Be wrong as usual.

Here in Aus' that means you move too fast for the flies to settle .. (fast being both physical and/or mental of course )
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Reissue Challenge: Get all system variables with values
« Reply #37 on: March 12, 2010, 12:17:24 AM »

So, we can now return to our normal broadcast ...
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Reissue Challenge: Get all system variables with values
« Reply #38 on: March 12, 2010, 08:48:41 AM »
You just couldn't resist stirring the pot could you. 8-)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Re: Reissue Challenge: Get all system variables with values
« Reply #39 on: March 12, 2010, 01:46:03 PM »
Well i found some of my code that i used to generate that dat file but there are two problems with it:
1. the code is very specific and not very good (looks like i wrote most of it in a hurry).
2. All i have is about a couple of hundred lines of `parsing' code left. i must have typed over my code instead of making a new procedures as i parsed the files.

I can post some of the more useful items i have left, like this list i got from SMadsen a long time ago.
Code: [Select]
(setq get-sys-vars-list
 '(
         ;;;System related
         (getenv "Path")                    ;string System search paths
         (getenv "COMSPEC")                 ;string Cmd.exe path
         (getenv "UserName")                ;string User logon name
         (getenv "Temp")                    ;string Temp path
         (getenv "TMP")                     ;string Temp path
         (getenv "ComputerName")            ;string Computer name
         (getenv "Windir")                  ;string Windows path
         (getenv "OS")                      ;string Operating system
         (getenv "UserProfile")             ;string Current user profile path
         (getenv "Pathext")                 ;string Exec extensions
         (getenv "SystemDrive")             ;string System drive
         (getenv "SystemRoot")              ;string System root path
         (getenv "MaxArray")                ;integer

         ;;;General
         (getenv "ACAD")                    ;string Support search paths
         (getenv "ANSIHatch")               ;string Pattern file for ANSI setup 1
         (getenv "ANSILinetype")            ;string Linetype file for ANSI setup 1
         (getenv "ISOHatch")                ;string Pattern file for ISO setup 1
         (getenv "ISOLinetype")             ;string Linetype file for ISO setup 1
         (getenv "StartUpType")             ;string Current default for StartUp dialog
         (getenv "Measureinit")             ;string MEASUREINIT
         (getenv "InsertUnitsDefSource")    ;integer INSUNITSDEFSOURCE
         (getenv "InsertUnitsDefTarget")    ;integer INSUNITSDEFTARGET
         (getenv "LastTemplate")            ;string Last DWT used
         (getenv "Pickstyle")               ;integer
         (getenv "Coords")                  ;integer
         (getenv "ShowProxyDialog")         ;integer
         (getenv "Osmode")                  ;integer
         (getenv "EdgeMode")                ;integer
         (getenv "PAPERUPDATE")             ;integer
         (getenv "ACADPLCMD")               ;string Plotter command string
         (getenv "ImageHighlight")          ;integer
         (getenv "Attdia")                  ;integer
         (getenv "Attreq")                  ;integer
         (getenv "Delobj")                  ;integer
         (getenv "Dragmode")                ;integer
         (getenv "UseMRUConfig")            ;integer
         (getenv "PLSPOOLALERT")            ;integer
         (getenv "PLOTLEGACY")              ;integer
         (getenv "PSTYLEPOLICY")            ;integer
         (getenv "OLEQUALITY")              ;integer
         (getenv "Anyport")                 ;integer
         (getenv "Validation Policy")       ;integer
         (getenv "Validation Strategy")     ;integer
         (getenv "CommandDialogs")          ;integer CMDDIA
         (getenv "TempDirectory")           ;string Temp dir
         (getenv "PlotSpoolerDirectory")    ;string Spooler dir
         (getenv "DefaultLoginName")        ;string Default login
         (getenv "MenuFile")                ;string Default menu path
         (getenv "NetLocation")             ;string Default URL
         (getenv "ACADDRV")                 ;string Driver path
         (getenv "ACADHELP")                ;string Help path
         (getenv "PrinterConfigDir")        ;string Plotter path
         (getenv "PrinterStyleSheetDir")    ;string Plot styles path
         (getenv "PrinterDescDir")          ;string Plotter driver path
         (getenv "NewStyleSheet")           ;string Default .stb/.ctb file
         (getenv "DefaultFormatForSave")    ;integer Default saveas
         (getenv "DefaultConfig")           ;string Default pc3
         (getenv "LastModifiedConfig")      ;string Last pc3
         (getenv "MRUConfig")               ;string pc3?
         (getenv "ACADLOGFILE")             ;string Logfile
         (getenv "MaxDwg")                  ;integer
         (getenv "AVEMAPS")                 ;string Texture files path
         (getenv "TemplatePath")            ;string Templates path
         (getenv "DatabaseWorkSpacePath")   ;string Data Links path
         (getenv "DefaultPlotStyle")        ;string e.g. "ByLayer"
         (getenv "DefaultLayerZeroPlotStyle") ;string e.g."Normal"
         (getenv "LineWeightUnits")         ;integer
         (getenv "LWDEFAULT")               ;integer Default lineweight
         (getenv "CustomColors")            ;integer
         (getenv "Blipmode")                ;integer
         (getenv "ToolTips")                ;string
         (getenv "acet-Enable")             ;string
         (getenv "acet-MenuLoad")           ;string Loading of Express Tools menu
         (getenv "AcetRText:type")          ;string Current default for RTEXT, e.g. "Diesel"
         ;;added 02.10.01
         (getenv "CmdVisLines")             ;string Number of lines in command line window
         (getenv "MaxHatch")                ;string Maximum number of segments allowed in hatch pattern. Range 100 - 10000000
         ;;added 10.10.01 that's not a binary address but a date
         (getenv "AutoSnapColor")           ;string AutoSnap colour Integer
         (getenv "AutomaticSaveMinutes")    ;string Minutes between AutoSave

         ;; 1 used by MEASUREINIT and MEASUREMENT sysvars

         ;;;Editor Configuration
         (getenv "SDF_AttributeExtractTemplateFile") ;string ??
         (getenv "AutoSnapPolarAng")        ;string POLARANG
         (getenv "AutoSnapPolarDistance")   ;string POLARDIST
         (getenv "AutoSnapPolarAddAng")     ;string POLARADDANG
         (getenv "AutoSnapControl")         ;integer AUTOSNAP
         (getenv "AutoSnapTrackPath")       ;integer TRACKPATH
         (getenv "PickBox")                 ;integer PICKBOX
         (getenv "AutoSnapSize")            ;integer
         (getenv "PickFirst")               ;integer PICKFIRST
         (getenv "PickAuto")                ;integer PICKAUTO
         (getenv "MenuOptionFlags")         ;integer MENUCTL
         (getenv "FontMappingFile")         ;string
         (getenv "LogFilePath")             ;string
         (getenv "PSOUT_PrologFileName")    ;string
         (getenv "MainDictionary")          ;strin
         (getenv "CustomDictionary")        ;string
         (getenv "MTextEditor")             ;string
         (getenv "XrefLoadPath")            ;string
         (getenv "SaveFilePath")            ;string
         (getenv "AcadLspAsDoc")            ;string

         ;;;Drawing Window
         (getenv "Background")              ;integer Background color
         (getenv "Layout background")       ;integer PS Background color
         (getenv "XhairPickboxEtc")         ;integer Crosshair color
         (getenv "LayoutXhairPickboxEtc")   ;integer PS Crosshair color
         (getenv "Autotracking vector")     ;integer Autotracking vector color
         (getenv "MonoVectors")             ;integer
         (getenv "FontFace")                ;string Screen Menu
         (getenv "FontHeight")              ;integer
         (getenv "FontWeight")              ;integer
         (getenv "FontItalic")              ;integer
         (getenv "FontPitchAndFamily")      ;integer
         (getenv "CursorSize")              ;integer
         (getenv "HideWarningDialogs")      ;integer
         (getenv "SDIMode")                 ;integer

         ;;;Command Line Windows
         (getenv "CmdLine.ForeColor")       ;integer
         (getenv "CmdLine.BackColor")       ;integer
         (getenv "TextWindow.ForeColor")    ;integert
         (getenv "TextWindow.BackColor")    ;integer
         (getenv "CmdLine.FontFace")        ;string
         (getenv "CmdLine.FontHeight")      ;integer
         (getenv "CmdLine.FontWeight")      ;integer
         (getenv "CmdLine.FontItalic")      ;integer
         (getenv "CmdLine.FontPitchAndFamily") ;integer
         (getenv "TextWindow.FontFace")     ;string
         (getenv "TextWindow.FontHeight")   ;integer
         (getenv "TextWindow.FontWeight")   ;integer
         (getenv "TextWindow.FontItalic")   ;integer
         (getenv "TextWindow.FontPitchAndFamily") ;integer
    )
 )
;;;  Just the strings...
;;; (mapcar '(lambda (x) (cadr x)) get-sys-vars-list)

I was also thinking that the acad.exe isnt going to hold a lot of the better easter eggs we could find.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: Reissue Challenge: Get all system variables with values
« Reply #40 on: March 12, 2010, 02:23:58 PM »
It sounds a little roundabout, but I suppose you could set up a reactor to monitor and log system variable changes, along with a "learn" on/off switch so it doesn't bog too much down.  It might not get *all* of the system variables but it should pick up the ones actually being used.
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Re: Reissue Challenge: Get all system variables with values
« Reply #41 on: March 12, 2010, 02:24:58 PM »
You just couldn't resist stirring the pot could you. 8-)


 :evil: