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

0 Members and 1 Guest are viewing this topic.

#### T.Willey

• Needs a day job
• Posts: 5241
##### Re: Challenge: Get all system variables with values
« Reply #15 on: October 11, 2006, 06:59:54 PM »
I will look for a better way.  Here is a brute force coded way.  I have one working right now that will go up to 15 letters, don't know how long it will take, it's in a spare Acad right now running.
Code: [Select]
(defun c:GetSysVars (/ Str VarList)
; Returned with only going up to "AAAAA"
; (("DATE" . 2.45402e+006) ("CTAB" . "Layout1") ("AREA" . 0.0) ("SDI" . 0))

(defun UpStringLetters (String Location)

(cond
((equal Location 0)
(strcat "A" String)
)
((= (substr String Location 1) "Z")
(UpStringLetters
(strcat
(substr String 1 (1- Location))
"A"
(substr String (1+ Location))
)
(1- Location)
)
)
((equal (strlen String) 1)
(chr (1+ (ascii String)))
)
(T
(strcat
(substr String 1 (1- Location))
(chr (1+ (ascii (substr String Location 1))))
(substr String (1+ Location))
)
)
)
)
;------------------------------------------------------------
(setq Str "AAA")
(while (< (strlen Str) 16)
(if (getVar Str)
(setq VarList (cons (cons Str (getvar Str)) VarList))
)
(setq Str (UpStringLetters Str (strLen Str)))
)
VarList
)
Tim

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

#### kpblc

• Bull Frog
• Posts: 357
##### Re: Challenge: Get all system variables with values
« Reply #16 on: October 12, 2006, 01:06:13 AM »
Sorry for my English.

#### CAB

• Global Moderator
• Seagull
• Posts: 10388
##### Re: Challenge: Get all system variables with values
« Reply #17 on: October 12, 2006, 07:47:40 AM »
That's very interesting.
Thanks kpblc
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970

#### daron

• Guest
##### Re: Challenge: Get all system variables with values
« Reply #18 on: October 12, 2006, 08:55:52 AM »
This is what I got:
Quote
Initializing...

routine will examine your system and write a text file
Press ENTER to continue or ESC to cancel...

#### Guest

• Guest
##### Re: Challenge: Get all system variables with values
« Reply #19 on: October 12, 2006, 09:06:23 AM »
I got a 284KB text file... most of which I can't understand (damn vla-blah blah blah blah).

I suppose if I understood it, it would make more sense.  Kinda interesting little program though.  It spit out EVERYTHING you could imagine; even the variables of my home-grown programs!

#### CAB

• Global Moderator
• Seagull
• Posts: 10388
##### Re: Challenge: Get all system variables with values
« Reply #20 on: October 12, 2006, 09:09:05 AM »
See my output file attached.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970

#### kpblc

• Bull Frog
• Posts: 357
##### Re: Challenge: Get all system variables with values
« Reply #21 on: October 12, 2006, 09:27:12 AM »
Code: [Select]
Initializing...

will examine your system and write a text file called
Press ENTER to continue or ESC to cancel...

Formatting and writing ouput. Please wait...-

Done.
My result in in attached file.
> daron : it seems strange. Sometimes et-functions returns errors. In this case try to reinstall them.
Sorry for my English.

#### CAB

• Global Moderator
• Seagull
• Posts: 10388
##### Re: Challenge: Get all system variables with values
« Reply #22 on: October 12, 2006, 09:53:17 AM »
Just tested in AK2, AK4 & AK6. AK2 uses a 1999 acadinfo.lsp while AK4 & AK6 have a 2002 version of acadinfo.lsp on my system.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970

#### MP

• Seagull
• Posts: 17662
• Have thousands of dwgs to process? Contact me.
##### Re: Challenge: Get all system variables with values
« Reply #23 on: October 12, 2006, 10:06:24 AM »
If you examine acadinfo.lsp, which isn't written particularly well, you'll see that the sysvars are hard coded, and that's not what I think Tim is looking for. If I understand his posts he's looking for a way to query AutoCAD / "The System" and have it ante up all the variables, ergo the brute force program he's currently running.

No problem My pleasureTim.

Edit: My wife says "No problem" all the time because everyone at her work says that and I can't stand it. Can't believe I just posted same. Carry on.

I know what you mean.  I've been trying to kick the habbit of saying it also.  When people say 'thank you' and I respond with 'no problem' instead of 'you're welcome' or something, I'm just like 'why did I say that'  oh well.  I will learn soon enough.

Thanks again Michael.

You're most welcome Tim.

Engineering Technologist • CAD Specialist • Programmer Analyst
Design • Drafting • Document Control • Automation.

#### MP

• Seagull
• Posts: 17662
• Have thousands of dwgs to process? Contact me.
##### Re: Challenge: Get all system variables with values
« Reply #24 on: October 12, 2006, 10:09:39 AM »
PS: That's not to say there isn't value in using acadinfo.lsp; just saying I don't think it meets Tim's requirements.

Engineering Technologist • CAD Specialist • Programmer Analyst
Design • Drafting • Document Control • Automation.

#### T.Willey

• Needs a day job
• Posts: 5241
##### Re: Challenge: Get all system variables with values
« Reply #25 on: October 12, 2006, 11:24:32 AM »
Thanks, but I get the same error that Daron gets when trying it, and if it is hard coded like Michael said (not reason not to believe him) then that isn't what I was looking for.  They might not have all the system variables in there to begin with, so one wouldn't get a full list.

So I changed my code to write a text file instead, so I left it on last night, and when I got here this morning, IT WAS STILL RUNNING.  Here is the output of the text file.  I will run it again tonight when I leave.

Edit: Use code tags instead of quote tags.  Got smilies.
Edit: Was run in Acad 07
Code: [Select]
("SDI" . 0)
("AREA" . 0.0)
("CTAB" . "Layout1")
(DATE . 2.45402e+006)
(APBOX . 0)
(BACKZ . 0.0)
(CDATE . 2.0061e+007)
(DBMOD . 5)
(DIMTM . 0.0)
(DIMTP . 0.0)
(ERRNO . 93)
(GFANG . 0.0)
(GRIPS . 1)
(HPANG . 0.0)
(SURFU . 6)
(SURFV . 6)
(UCSVP . 1)
(VSMAX . (7379.14 4320.0 0.0))
(VSMIN . (-5606.58 -2880.0 0.0))
(VTFPS . 7)
(XEDIT . 1)
(AFLAGS . 16)
(ANGDIR . 0)
(ATTDIA . 0)
(ATTREQ . 1)
(AUNITS . 0)
(AUPREC . 8)
(BVMODE . 0)
(CLAYER . 0)
(CMDDIA . 1)
(COORDS . 1)
(CVPORT . 2)
(DELOBJ . 1)
(DIMALT . 0)
(DIMASO . 1)
(DIMASZ . 0.09375)
(DIMBLK . )
(DIMCEN . 0.0)
(DIMDEC . 2)
(DIMDLE . 0.0625)
(DIMDLI . 0.0625)
(DIMEXE . 0.0625)
(DIMEXO . 0.0625)
(DIMFIT . 5)
(DIMFXL . 1.0)
(DIMGAP . 0.0625)
(DIMLIM . 0)
(DIMLWD . -2)
(DIMLWE . -2)
(DIMRND . 0.0)
(DIMSAH . 0)
(DIMSHO . 1)
(DIMTIH . 0)
(DIMTIX . 0)
(DIMTOH . 0)
(DIMTOL . 0)
(DIMTSZ . 0.0)
(DIMTVP . 0.0)
(DIMTXT . 0.125)
(DIMUPT . 0)
(DIMZIN . 12)
(DRAGVS . )
(EXPERT . 0)
(EXTMAX . (-1.0e+020 -1.0e+020 -1.0e+020))
(EXTMIN . (1.0e+020 1.0e+020 1.0e+020))
(FRONTZ . 0.0)
(GFNAME . 1)
(GTAUTO . 1)
(HPNAME . ANSI31)
(LIMMAX . (2016.0 1440.0))
(LIMMIN . (0.0 0.0))
(LOCALE . ENU)
(LOCKUI . 0)
(LUNITS . 4)
(LUPREC . 8)
(NOMUTT . 0)
(OSMODE . 4133)
(OSNAPZ . 0)
(PDMODE . 0)
(PDSIZE . 0.0)
(POPUPS . 1)
(SKPOLY . 0)
(TARGET . (0.0 0.0 0.0))
(UCSORG . (0.0 0.0 0.0))
(ANGBASE . 0.0)
(APSTATE . 0)
(ATTMODE . 1)
(AUXSTAT . 0)
(CECOLOR . BYLAYER)
(CELTYPE . ByLayer)
(CMDECHO . 0)
(CMLJUST . 0)
(COMPASS . 0)
(DCTCUST . C:\Documents and Settings\a0kcdzz\Application Data\Autodesk\AutoCAD 2007\R17.0\enu\support\sample.cus)
(DCTMAIN . enu)
(DIASTAT . 1)
(DIMALTD . 2)
(DIMALTF . 25.4)
(DIMALTU . 2)
(DIMALTZ . 0)
(DIMAZIN . 0)
(DIMCLRD . 0)
(DIMCLRE . 0)
(DIMCLRT . 0)
(DIMDSEP . .)
(DIMFRAC . 0)
(DIMJUST . 0)
(DIMLFAC . 1.0)
(DIMPOST . )
(DIMSOXD . 0)
(DIMTDEC . 2)
(DIMTFAC . 1.0)
(DIMTOFL . 1)
(DIMTOLJ . 1)
(DIMTZIN . 0)
(DIMUNIT . 2)
(DONUTID . 0.5)
(DONUTOD . 1.0)
(DRSTATE . 0)
(DTEXTED . 2)
(DWGNAME . Drawing2.dwg)
(DYNMODE . 0)
(ENTEXTS . 1)
(ENTMODS . 9)
(ERSTATE . 1)
(FILEDIA . 1)
(FONTALT . simplex.shx)
(GFSHIFT . 0)
(GRIPHOT . 1)
(HALOGAP . 0)
(HANDLES . 1)
(HPASSOC . 1)
(HPBOUND . 1)
(HPSCALE . 1.0)
(HPSPACE . 1.0)
(INSBASE . (0.0 0.0 0.0))
(INSNAME . )
+++ Error! Last string evaluated was JPHWKJQ +++
« Last Edit: October 12, 2006, 11:27:29 AM by T.Willey »
Tim

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

#### daron

• Guest
##### Re: Challenge: Get all system variables with values
« Reply #26 on: October 12, 2006, 01:21:21 PM »
Quote
I suppose if I understood it, it would make more sense.  Kinda interesting little program though.  It spit out EVERYTHING you could imagine; even the variables of my home-grown programs!
I think the "home-grown" comment might be where the real culprit is. I have a few that I have yet to discover what's wrong with them, so I'm sure it errored out with that.

#### John Kaul (Se7en)

• Needs a day job
• Posts: 9484
##### Re: Challenge: Get all system variables with values
« Reply #27 on: October 12, 2006, 06:39:40 PM »
*blink blink* WOW. This sounds like something that could be fun. *hummmm*
[Se7en: Nods to the others, turns and walks away.]
[Se7en: Has left]
TheSwamp.org (serving the CAD community since 2003)

Donate to TheSwamp.org

#### Guest

• Guest
##### Re: Challenge: Get all system variables with values
« Reply #28 on: October 13, 2006, 10:57:12 AM »
So whadja get Tim??  Did you run it last night??

Just curious to find out what Autodesk is trying to hide.

#### CAB

• Global Moderator
• Seagull
• Posts: 10388
##### Re: Challenge: Get all system variables with values
« Reply #29 on: October 13, 2006, 11:04:20 AM »
Tim,
Looks like you need to change the way empty strings are output.
Code: [Select]
(DIMBLK . )  -----> (DIMBLK . "")I can run it on 2006 if you want to compare or maybe you have 6 still.
« Last Edit: October 13, 2006, 11:06:12 AM by CAB »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970