Jump to content

Need predefined selection in checkbox


Manuel_Kunde

Recommended Posts

Hi all, this is a cutout of a dcl file with toggle boxes.

How can I predefine the selection "lathe machine"? (So that this checkbox is always checked). Currently, the selection that was previously selected is always applied. With radio-buttons it works with "value=1", but not in this case.

 

    : toggle {
      key = "tool";
      label = "lathe machine";
      value = "1";
    }

 

image.png.bc1a48d5abfebf274a5e6dcc2a476c7c.png

 

Thanks so far.

Link to comment
Share on other sites

Guessing you are using and edit version of this? screen shots look the same but cropped.

https://autolisp-exchange.com/Tutorials/MyDialogs.htm#MyToggles

 

If you want the same defaults check every time you run it and not previously selected change the following.

 

(defun c:MyToggles (/ Dcl_Id% Toggle1$ Toggle2$ Toggle3$ Toggle4$ Toggle5$ Return#)
  (princ "\nMyToggles")(princ)
  ; Set Default Variables
  (if (not *MyToggles@);Unique global variable name to store dialog info
    (setq *MyToggles@ (list nil "0" "0" "0" "0" "0"))
  );if

Change to

(defun c:MyToggles (/ *MyToggles@ Dcl_Id% Toggle1$ Toggle2$ Toggle3$ Toggle4$ Toggle5$ Return#)
  (princ "\nMyToggles")(princ)
  (setq *MyToggles@ (list nil "0" "0" "1" "0" "0")) ;if Lathe was Toggle3$ option it will be checked.
  ....
  (setq *MyToggles@ (list nil Toggle1$ Toggle2$ Toggle3$ Toggle4$ Toggle5$)) ;isn't needed anymore comment out or delete.

 

I was only able to trouble shoot this because I could look at all the code. pet pev of mine "I need help but i only want to show you this little section of code" 90% of the time the error is outside of what people are showing, case in point.

Edited by mhupp
Link to comment
Share on other sites

Mhupp did something similar but radio buttons as a 2 column select its a library routine based on Multi radio buttons.lsp, I am looking at making it multi columns, auto columns based on the number of column lists provided 1, 2, 3, etc . I have toggle 1 column but same idea multi column makes dcl on demand rather than hard coded dcl. Interesting maybe can do row or col ? The row or col works in Multi radio buttons V or H.

 

Its on the wish list do a toggle version.

 

image.thumb.png.75b0e99d6e9eaffc03a65764f3d7faf4.png

 

 

Link to comment
Share on other sites

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...