guitarguy1685 Posted March 29, 2010 Posted March 29, 2010 is it possible? I have a lisp written as a variable for another lisp. The major lisp will insert a block and prompt you to annotate the part. The minor lisp asks if you want to be prompted, if you want to annotate every time or if you do not want to annotate every time. This variable has to be set every time I start a drawing. Is there a way so that I just have to set it once and it's saved for the entire time my sesion is open? Quote
Lee Mac Posted March 29, 2010 Posted March 29, 2010 Use a global variable, set it in the ACADDOC.lsp Quote
JohnM Posted March 29, 2010 Posted March 29, 2010 AutoCAD variables are in two categories those that are saved in the drawing and those that are save to the registry. In lisp you can create you own registry keys and write information to that key and then retrieve the info. (vl-registry-write reg-key [val-name val-data]) (vl-registry-read reg-key [val-name]) just another way to do it Quote
MSasu Posted March 29, 2010 Posted March 29, 2010 Also may take a look to USERI1-5 (integers), USERR1-5 (reals) and USERS1-5 (strings) system variables. Regards, Quote
TimSpangler Posted March 29, 2010 Posted March 29, 2010 is it possible? I have a lisp written as a variable for another lisp. The major lisp will insert a block and prompt you to annotate the part. The minor lisp asks if you want to be prompted, if you want to annotate every time or if you do not want to annotate every time. This variable has to be set every time I start a drawing. Is there a way so that I just have to set it once and it's saved for the entire time my sesion is open? You mean something like: (setenv "varname" "varvalue") and (getenv "varname") Variabale value: A string specifying the name of the variable to be read. Environment variable names must be spelled and cased exactly as they are stored in the system registry. Quote
guitarguy1685 Posted March 30, 2010 Author Posted March 30, 2010 thanks guys. some great suggestions. Lee Mac, i'll prob set that on my computer as a quick fix but I need something that any user can change back and forth. AutoCAD variables are in two categories those that are saved in the drawing and those that are save to the registry. In lisp you can create you own registry keys and write information to that key and then retrieve the info. (vl-registry-write reg-key [val-name val-data]) (vl-registry-read reg-key [val-name]) just another way to do it First off would it be dangerous to try this method seeing as i'm messing witht the registry? and where in the registery would this be stored? Also may take a look to USERI1-5 (integers), USERR1-5 (reals) and USERS1-5 (strings) system variables. Regards, yeah I totally forgot about these. Thanks for bringing it up You mean something like: (setenv "varname" "varvalue")and (getenv "varname") Variabale value: A string specifying the name of the variable to be read. Environment variable names must be spelled and cased exactly as they are stored in the system registry. can you create your own? I thought these were all predefined. Quote
Lee Mac Posted March 30, 2010 Posted March 30, 2010 If you are going with the registry options, make sure you choose a key that is unique, otherwise there can be dire conseqences Quote
TimSpangler Posted March 30, 2010 Posted March 30, 2010 thanks guys. some great suggestions. can you create your own? I thought these were all predefined. You can create your own. Quote
guitarguy1685 Posted March 30, 2010 Author Posted March 30, 2010 You can create your own. the setenv/getenv seems to do exactly what I want. Were these commands made available specifically to create system variables? If not what was the original intent? I prefer this over having to mess with the registry. Also I was not able to use USERS1-5 variables. They seem to only work on a sheet by sheet basis. Quote
Lee Mac Posted March 31, 2010 Posted March 31, 2010 I prefer this over having to mess with the registry. Getenv/Setenv do mess with the registry Quote
Lee Mac Posted March 31, 2010 Posted March 31, 2010 Setenv creates a key at: HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\RXX.X\ACAD-XXXX:XXX\FixedProfile\General Quote
MSasu Posted March 31, 2010 Posted March 31, 2010 At least the SETENV/GETENV is a safer solution to record information in registry than VL-REGISTRY-? series (even if there are some access restriction). Regards, Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.