Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Reading system envionment

0 views
Skip to first unread message

Dagfinn S.

unread,
Apr 22, 1999, 3:00:00 AM4/22/99
to
From Autocad it's possible to read the NT system environment by using
the getenv function. So far everything looks fine. But if I use the
function setenv with the same environment name, it's not possible to
read the NT system environment any more. It looks like the
environments are saved in two different places in then registry.
Help wanted.

Dagfinn

Morten Warankov

unread,
Apr 22, 1999, 3:00:00 AM4/22/99
to
This mail is replied to 'autodesk.autocad.customization', and a copy is sent
to the author.

Dagfinn,

Environment variables are saved in the registry and a copy of the default
settings are loaded into an application upon startup.
Due to this, changes to environment variables can affect running
applications for changes ONLY within this environment (unless you create a
method to read/write to registry, see below).
Some applications updates the registry upon closing. However, since NT does
not nescessarily update the registry until it is ended, you may have to
restart NT to allow your change in one appliaction to take effect as an
updated registry setting to be read in another application.

Consequently, (setenv) and (getenv) maintains environment variables within
your ACAD session, and they are deleted when ACAD ends.
If you want to maintain the registry, use the (vlx-registry-read) and
(vlx-registry-write) within the VLIDE (Visual Lisp for R14, Vital Lisp for
R13, available from URL below). As far as I remember those two functions
directly updates an running NT, so you don't have to close ACAD or re-start
NT, but you may have to re-start other running applications to see the
changes take effect (unless you have the similar method in that other app.)

Hope this helps,

Mortenw
--
***************************************************************************
* A B A C U S
*
* Prof. Brochs gt. 6 Phone: (+47) 73 54 03 15 *
* N-7030 TRONDHEIM Fax: (+47) 73 94 38 61 *
* NORWAY E-mail: aba...@abacus.no *
* URL: http://www.abacus.no
*
*
*
* Formula for success: Underpromise and overdeliver. *
***************************************************************************
Dagfinn S. wrote in message <371ed31a...@adesknews.autodesk.com>...

Tony Tanzillo

unread,
Apr 22, 1999, 3:00:00 AM4/22/99
to
I don't know where you're getting your information from,
but this is entirely wrong.

Morten Warankov wrote:

> Some applications updates the registry upon closing.
> However, since NT does not nescessarily update the
> registry until it is ended, you may have to restart
> NT to allow your change in one appliaction to take
> effect as an updated registry setting to be read in
> another application.
>

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

Morten Warankov

unread,
Apr 23, 1999, 3:00:00 AM4/23/99
to
Tony Tanzillo wrote in message <371F0E32...@worldnet.att.net>...

>I don't know where you're getting your information from,

Tony,
noone can be an expert on everything, so you're excused for not knowing
this.

From the NT help file. Topic environment variables:
Windows NT saves changes in the registry so they are available automatically
the next time you start your computer.
Changes don’t affect programs that are running, and may not take affect
until after you restart your computer.

Glad to assist an expert,

0 new messages