remember lisp variables after closing acad?

Hello This is working perfekt but how to make it remember the last number after closing and opening acad and current drawing??
Peeter

file
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
If it is the same drawing you wish to remember the number then you can use one of the users vars. It been awhile but I think the syntax is (setvar uservar value) where uservar is user1, user2 <--look these up to make sure these are the correct names: and value is the number you want to store. Then to retreive it would be (setq value (getvar uservar))
Peeter wrote:

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Well ... sort of. The User Variables are USERI1 - USERI5 (integers), USERR1 - USERR5 (reals), and USERS1 -USERS5 (strings). USERRn and USERIn values are stored in the .dwg file, but USERSn values are not. And the syntax is (for example):
(setvar "USERI1" value) and (setq value (getvar "USERI1")) ___

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Does AutoCAD support SETENV and GETENV like LT does? Then you can save values in the registry insead of in the dwg.
Conny

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Not as native commands, but as LISP expressions:
(setenv "MyVariable" "MyValue") and (getenv "MyVariable")
I mentioned this possibility in my earlier post to this thread. ___

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.