Easy way to make a collection of the sysvar settings?

Easy way to make a collection of the sysvar settings?

Anonymous
Not applicable
129 Views
8 Replies
Message 1 of 9

Easy way to make a collection of the sysvar settings?

Anonymous
Not applicable
Is there a easy way to get all the sysvar settings so I can list them out in
a file? Do I have to use Getvar on each one individually by name?

--
Kent Keller
Strobe Data Inc.
www.strobedata.com
Signs of the Times
LOG ON: Makin a wood stove hotter
0 Likes
130 Views
8 Replies
Replies (8)
Message 2 of 9

Anonymous
Not applicable
If you don't mind a manual method, you can open up the AutoCAD help file and
get a complete, alphabetical listing of sysvars. With a little cut and
paste, you'll be good to go.

Kent Keller wrote in message
news:85dkpk$3pb6@adesknews2.autodesk.com...
> Is there a easy way to get all the sysvar settings so I can list them out
in
> a file? Do I have to use Getvar on each one individually by name?
>
> --
> Kent Keller
> Strobe Data Inc.
> www.strobedata.com
> Signs of the Times
> LOG ON: Makin a wood stove hotter
>
>
>
0 Likes
Message 3 of 9

Anonymous
Not applicable
Frank

I could also use the bonus tools system variable editor and use the saveall
to a file, but what isn't what I am really after.

I am looking for the easiest way to do basically the same thing as the bonus
tools program, only with a lot of other things also. (so unfortunately I
can't use its output) I was just hoping there was some way to step thru all
the sysvars as a collection like you can with textstyles or linetypes
without having to type in getvar for each sysvar.

I want to end up with a file that has the following format

acadlspasdoc,0
acadprefix,
Thru
zoomfactor,10

--
Kent Keller
Strobe Data Inc.
www.strobedata.com
Signs of the Times
LOG ON: Makin a wood stove hotter

"Frank Oquendo" wrote in message
news:85dksv$3p41@adesknews2.autodesk.com...
> If you don't mind a manual method, you can open up the AutoCAD help file
and
> get a complete, alphabetical listing of sysvars. With a little cut and
> paste, you'll be good to go.
>
0 Likes
Message 4 of 9

Anonymous
Not applicable
Kent,
This is a shot in the dark, but how about something to the effect of:

dim Obj as object ' or acadobject
dim myvar as string
For Each Obj in AutoCAD
If typeof Obj is Const then ' or when looking for settings - if typeof
obj is enum then
myvar = obj.name
'add myvar to an array or list
end if
next

Like I said, a shot in the dark. I don't know if the variables are really
considered to be objects, but I know that that you can see the variables under
AutoCAD from within vba.
hope this helps,
-Josh
0 Likes
Message 5 of 9

Anonymous
Not applicable
Go to the Customer Files NG and download the attachment from my post
'UPDATE: avUtils 1.0.27' The attached dll has a GetSysVars method which will
return a dictionary object containing all documented sysvars.

"Kent Keller" wrote in message
news:85dkpk$3pb6@adesknews2.autodesk.com...
> Is there a easy way to get all the sysvar settings so I can list them out
in
> a file? Do I have to use Getvar on each one individually by name?
>
> --
> Kent Keller
> Strobe Data Inc.
> www.strobedata.com
> Signs of the Times
> LOG ON: Makin a wood stove hotter
>
>
>
0 Likes
Message 6 of 9

Anonymous
Not applicable
You can do this without any third-party "tools".

Just do a SETVAR ? and list the names of all
system variables to your text console, then
copy them to a text file and format them as
an array in VBA.

Dim VarNames(0 To ) as String

VarNames(0) = "VARNAME1"
VarNames(1) = "VARNAME2"....

Then, you can just iterate through the array
and call GetVariable() with each array element.

Kent Keller wrote:
>
> Is there a easy way to get all the sysvar settings so I can list them out in
> a file? Do I have to use Getvar on each one individually by name?
>
> --
> Kent Keller
> Strobe Data Inc.
> www.strobedata.com
> Signs of the Times
> LOG ON: Makin a wood stove hotter

--
/*********************************************************/
/* Tony Tanzillo Design Automation Consulting */
/* Programming & Customization for AutoCAD & Compatibles */
/* ----------------------------------------------------- */
/* tony.tanzillo@worldnet.att.net */
/* http://ourworld.compuserve.com/homepages/tonyt */
/*********************************************************/
0 Likes
Message 7 of 9

Anonymous
Not applicable
Frank

Thanks for the Dll, wish I had it when I started this.

But with it I still have the same problem. I don't think there is
any problem in the part of my code that accesses the sysvars, but
the sysvar settings aren't updated to the dimstyle's settings when
I make it active. I am either completely missing the boat here or
there is a bug in getvar doesn't return the right value after
changing active dimstyles.

--
Kent Keller
Check out the Mechanical Desktop FAQ @
http://webhome.idirect.com/~dfulford/

"Frank Oquendo" wrote in message
news:8605ij$a2v26@adesknews2.autodesk.com...
> Go to the Customer Files NG and download the attachment from my
post
> 'UPDATE: avUtils 1.0.27' The attached dll has a GetSysVars
method which will
> return a dictionary object containing all documented sysvars.
>
> "Kent Keller" wrote in message
> news:85dkpk$3pb6@adesknews2.autodesk.com...
> > Is there a easy way to get all the sysvar settings so I can
list them out
> in
> > a file? Do I have to use Getvar on each one individually by
name?
> >
> > --
> > Kent Keller
> > Strobe Data Inc.
> > www.strobedata.com
> > Signs of the Times
> > LOG ON: Makin a wood stove hotter
> >
> >
> >
>
>
0 Likes
Message 8 of 9

Anonymous
Not applicable
Tony
Thanks, I ended up doing this

SysEntry$ = "ACADLSPASDOC ACISOUTVER Yadda Yadda Yadda "

While Len(SysEntry$) > 0
If InStr(SysEntry$, " ") > 0 Then
StepVar$ = Left(SysEntry$, InStr(SysEntry$, " ") - 1)
SysEntry$ = Mid(SysEntry$, InStr(SysEntry$, " ") + 1)

Not sure which way is more efficient, but this seems to be working
OK.

--
Kent Keller
Check out the Mechanical Desktop FAQ @
http://webhome.idirect.com/~dfulford/

"Tony Tanzillo" wrote in message
news:3883E72A.9B5251EB@worldnet.att.net...
> You can do this without any third-party "tools".
>
> Just do a SETVAR ? and list the names of all
> system variables to your text console, then
> copy them to a text file and format them as
> an array in VBA.
>
> Dim VarNames(0 To ) as String
>
> VarNames(0) = "VARNAME1"
> VarNames(1) = "VARNAME2"....
>
> Then, you can just iterate through the array
> and call GetVariable() with each array element.
>
> Kent Keller wrote:
> >
> > Is there a easy way to get all the sysvar settings so I can
list them out in
> > a file? Do I have to use Getvar on each one individually by
name?
> >
> > --
> > Kent Keller
> > Strobe Data Inc.
> > www.strobedata.com
> > Signs of the Times
> > LOG ON: Makin a wood stove hotter
>
> --
> /*********************************************************/
> /* Tony Tanzillo Design Automation Consulting */
> /* Programming & Customization for AutoCAD & Compatibles */
> /* ----------------------------------------------------- */
> /* tony.tanzillo@worldnet.att.net */
> /* http://ourworld.compuserve.com/homepages/tonyt */
> /*********************************************************/
0 Likes
Message 9 of 9

Anonymous
Not applicable
I would guess that expressing each element in the
array as a string literal would be more effecient,
but it may not matter much.

Kent Keller wrote:
>
> Tony
> Thanks, I ended up doing this
>
> SysEntry$ = "ACADLSPASDOC ACISOUTVER Yadda Yadda Yadda "
>
> While Len(SysEntry$) > 0
> If InStr(SysEntry$, " ") > 0 Then
> StepVar$ = Left(SysEntry$, InStr(SysEntry$, " ") - 1)
> SysEntry$ = Mid(SysEntry$, InStr(SysEntry$, " ") + 1)
>
> Not sure which way is more efficient, but this seems to be working
> OK.
>
> --
> Kent Keller
> Check out the Mechanical Desktop FAQ @
> http://webhome.idirect.com/~dfulford/
>
> "Tony Tanzillo" wrote in message
> news:3883E72A.9B5251EB@worldnet.att.net...
> > You can do this without any third-party "tools".
> >
> > Just do a SETVAR ? and list the names of all
> > system variables to your text console, then
> > copy them to a text file and format them as
> > an array in VBA.
> >
> > Dim VarNames(0 To ) as String
> >
> > VarNames(0) = "VARNAME1"
> > VarNames(1) = "VARNAME2"....
> >
> > Then, you can just iterate through the array
> > and call GetVariable() with each array element.
> >
> > Kent Keller wrote:
> > >
> > > Is there a easy way to get all the sysvar settings so I can
> list them out in
> > > a file? Do I have to use Getvar on each one individually by
> name?
> > >
> > > --
> > > Kent Keller
> > > Strobe Data Inc.
> > > www.strobedata.com
> > > Signs of the Times
> > > LOG ON: Makin a wood stove hotter
> >
> > --
> > /*********************************************************/
> > /* Tony Tanzillo Design Automation Consulting */
> > /* Programming & Customization for AutoCAD & Compatibles */
> > /* ----------------------------------------------------- */
> > /* tony.tanzillo@worldnet.att.net */
> > /* http://ourworld.compuserve.com/homepages/tonyt */
> > /*********************************************************/

--
/*********************************************************/
/* Tony Tanzillo Design Automation Consulting */
/* Programming & Customization for AutoCAD & Compatibles */
/* ----------------------------------------------------- */
/* tony.tanzillo@worldnet.att.net */
/* http://ourworld.compuserve.com/homepages/tonyt */
/*********************************************************/
0 Likes