nila_joy Posted March 18, 2012 Posted March 18, 2012 HI, I want to save the last user input value for DCL. Means if user input a value 100 in a user input dialog box.. when the program run next time it will show the existing value 100 in the user input box.. saving in excel is the only option for this? ..Regards, Subho India Quote
Tharwat Posted March 18, 2012 Posted March 18, 2012 global variable would take care of it , into one Autocad session of course . (cond (var) ((setq var 100.)) ) Quote
pBe Posted March 18, 2012 Posted March 18, 2012 This is how i set up my defaults for DCL Say i have three varaible names (setq InitVal '(("V1" "10") ("V2" "ABC") ("V3" "25.4"))) then (foreach Var InitVal ([b]set_tile[/b] (car var) (set (read (car var)) (if (setq dflt (eval (read (car var)))) (cond ((eq (setq ty (type dflt)) 'STR) dflt) ((eq ty 'REAL) (rtos dflt 2 2)) ((eq ty 'INT) (itoa dflt))) (cadr var))) ) ) Initial values would be a string. v1 ---- > "10" v2 ---- > "ABC" v3 ---- > "25.4" After runing the routine where the new values were assigned as: v1 ----- 24 [integer] v2 ----- "pBe" [string] v3 ----- 0.75 [Real] On the next run the snippet above will convert those back to a string v1 ----- "24" v2 ----- "pBe" v3 ----- "0.75" Hope this helps Quote
JohnM Posted March 19, 2012 Posted March 19, 2012 write the values to a text file that way the last values are always displayed have your dcl calling code check for the file and if it is found populate the values if not populate with default values. Quote
BIGAL Posted March 19, 2012 Posted March 19, 2012 UserI1-5 Userr1-5 Users1-5 This is a simple way of saving a variable into a dwg but note only that dwg if you want last then search for registory entry which can be retrieved at any time or I agree write a file. I used the save "userx" for setting defaults in a commercial product works very simple. 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.