Manuel_Kunde Posted September 22, 2021 Posted September 22, 2021 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"; } Thanks so far. Quote
mhupp Posted September 22, 2021 Posted September 22, 2021 (edited) 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 September 22, 2021 by mhupp Quote
BIGAL Posted September 23, 2021 Posted September 23, 2021 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. 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.