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

0 Members and 1 Guest are viewing this topic.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Challenge: Get all system variables with values
« Reply #45 on: October 16, 2006, 12:41:32 PM »
So, why not start every evening where you left off.
Sooner or later the strings will be tested.
"ZZZZZZZZZZZZZZZZ" :)
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.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Challenge: Get all system variables with values
« Reply #46 on: October 16, 2006, 12:49:43 PM »
Just to know.  I like knowing what I'm using, and I know you can get list of system variables off the net, but I was wondering how one would get a full list.  I think I have been to the hyperpics site for a list.  Thought it would be a fun thing to try.   :wink:  Seems a little harder than I thought though, but still fun.

I can fully understand and appreciate that.

:)

Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Challenge: Get all system variables with values
« Reply #47 on: October 16, 2006, 12:54:52 PM »
So, why not start every evening where you left off.
Sooner or later the strings will be tested.
"ZZZZZZZZZZZZZZZZ" :)
I was planning on that.  I change my code to ask where to start, and I planned on typing where it ended, but I still think this is the long road.  Maybe there isn't another road, but I still hope.  :ugly: :lol:
Tim

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

Please think about donating if this post helped you.

Guest

  • Guest
Re: Challenge: Get all system variables with values
« Reply #48 on: October 16, 2006, 01:55:00 PM »
Quote
For example, instead of the interrogation methods you've been employing you might use the information for the latest AutoCAD version from Autodesk (say Shaan Hurley's, or some para-site spin off) against any running version of AutoCAD (removing invalid members on the fly could be done relatively quickly).

That doesn't cover any vertical variables though.  I'd be interested to see what's inside LDT, ADT & ABS (since I have all three installed on my machine).

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Challenge: Get all system variables with values
« Reply #49 on: October 16, 2006, 02:09:48 PM »
I wonder if any other languages would know what ALL the system variables are.  Like if ObjectARX has a complete list somewhere.  Or if the other languages would be faster?  I will see what I can come up with.

/Thinking out loud.
Tim

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

Please think about donating if this post helped you.

rkmcswain

  • Swamp Rat
  • Posts: 978
Re: Challenge: Get all system variables with values
« Reply #50 on: March 01, 2007, 09:05:50 AM »
I wonder if any other languages would know what ALL the system variables are.  Like if ObjectARX has a complete list somewhere.  Or if the other languages would be faster?  I will see what I can come up with.

/Thinking out loud.

Any updated news on this topic?

Seems like there would be a way to hook the SETVAR command and extract the strings that it knows about (short of turning the logfileon and running [setvar;?;*]) I know that won't necessarily return the 'hidden' sysvars...

And I'm not even looking for the values - just the list of sysvar names. In such as way that you could run it on R14 or R2008 and it would return the sysvars...

The brute force method is not an option now with some 20 character sysvars in 2008....

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Challenge: Get all system variables with values
« Reply #51 on: March 01, 2007, 11:13:53 AM »
I have not found any way yet.  In fact I haven't even thought about this since my last post.  It would be cool if anyone could find a way to do it.
Tim

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

Please think about donating if this post helped you.

rkmcswain

  • Swamp Rat
  • Posts: 978
Re: Challenge: Get all system variables with values
« Reply #52 on: March 01, 2007, 02:34:58 PM »
This is ugly, but it works.

Code: [Select]
  (setvar "logfilemode" 0) 
  (setvar "logfilepath" "c:\\temp\\")
  (setvar "qaflags" 3)
  (setvar "logfilemode" 1)
  (command "setvar" "?" "*")
  (graphscr)
  (setvar "logfilemode" 0)
  (setq fp (open (getvar "logfilename") "r") lst '())
  (while (setq a (read-line fp))
    (setq lst (cons a lst))
  )
  (close fp)
  (vl-file-delete (getvar "logfilename"))
  (setq lst (reverse lst))
  (setq i 1 newlst '())
  (foreach item lst   
    (setq pos (vl-string-position 32 item))   
    (setq sv (substr item 1 pos))
    (setq a (ascii (substr sv 1 1)) b (ascii (substr sv 2 1)))
    (if (and (> a 64)(< a 91)(> b 64)(< b 91))  
        (setq newlst (cons (substr item 1 pos) newlst))
    )
  )
  (reverse newlst)

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Challenge: Get all system variables with values
« Reply #53 on: March 01, 2007, 02:58:13 PM »
Does it get them all? or just the one listed in the help files?  I would think just the ones list per
Seems like there would be a way to hook the SETVAR command and extract the strings that it knows about (short of turning the logfileon and running [setvar;?;*]) I know that won't necessarily return the 'hidden' sysvars...
Tim

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

Please think about donating if this post helped you.

rkmcswain

  • Swamp Rat
  • Posts: 978
Re: Challenge: Get all system variables with values
« Reply #54 on: March 01, 2007, 03:02:53 PM »
Does it get them all? or just the one listed in the help files?

Only what setvar;?;* reports. But if you are writing a routine that needs to know this list, it's slightly better than banking on a hardcoded list that will change between versions. Then again, maybe it isn't....???

You are right, if you are just trying to mine the sysvars for your own use and you want the "hidden" ones included, then that doesn't help much...

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Challenge: Get all system variables with values
« Reply #55 on: March 01, 2007, 03:19:36 PM »
Does it get them all? or just the one listed in the help files?

Only what setvar;?;* reports. But if you are writing a routine that needs to know this list, it's slightly better than banking on a hardcoded list that will change between versions. Then again, maybe it isn't....???

You are right, if you are just trying to mine the sysvars for your own use and you want the "hidden" ones included, then that doesn't help much...
Thanks for the clarification.  I was trying something of the latter.
Tim

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

Please think about donating if this post helped you.