Jump to content

Recommended Posts

Posted

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

Posted

global variable would take care of it , into one Autocad session of course .

 

(cond (var)
     ((setq var 100.))
     )

Posted

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

Posted

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.

Posted

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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...