Manuel_Kunde Posted November 11, 2021 Share Posted November 11, 2021 Hi all, I have variables here from a toggle dialog box that contain either the value 0 or 1. How can I create a list from them? (setq vision_pair1 (get_tile "t1") vision_pair2 (get_tile "t2") vision_pair3 (get_tile "t3") vision_pair4 (get_tile "t4") vision_pair5 (get_tile "t5") vision_pair6 (get_tile "t6") vision_pair7 (get_tile "t7") vision_pair8 (get_tile "t8") vision_pair9 (get_tile "t9") vision_pair10 (get_tile "t10") ) For example, I want to show all variables in an acet-ui-message (or alert-box) that contain the value 1. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted November 11, 2021 Share Posted November 11, 2021 (setq lst (mapcar 'get_tile '("t1" "t2" "t3" ..... etc))) Quote Link to comment Share on other sites More sharing options...
BIGAL Posted November 12, 2021 Share Posted November 12, 2021 You dont have to do it that way can just loop trough the toggle buttons as you know they are t+number. Simplest way is look at these programs, Multi Radio Buttons, Multi Getvals and Multi toggles are in the download section here at cadtutor. Yes the Multi Toggles makes a single list (0 1 0 1 1 1 0 1 0 1) The bit you want (defun mkv_lst ( / ) (setq v_lst '()) (setq x 1) (repeat (- (length ahbutlst) 1) (setq val (strcat "Tb" (rtos x 2 0))) (setq v_lst (cons (get_tile val) v_lst)) (setq x (+ x 1)) ) ) (setq y 0) (repeat (- (length ahbutlst) 1) (setq keynum (strcat "Tb" (rtos (setq y (+ Y 1)) 2 0))) (set_tile keynum "0") (mode_tile keynum 3) ) (action_tile "accept" "(mkv_lst)(done_dialog)") 1 Quote Link to comment Share on other sites More sharing options...
Manuel_Kunde Posted November 16, 2021 Author Share Posted November 16, 2021 On 11/12/2021 at 2:48 AM, BIGAL said: You dont have to do it that way can just loop trough the toggle buttons as you know they are t+number. Simplest way is look at these programs, Multi Radio Buttons, Multi Getvals and Multi toggles are in the download section here at cadtutor. Yes the Multi Toggles makes a single list (0 1 0 1 1 1 0 1 0 1) I modified this for my needs. Thanks for the code! Quote Link to comment Share on other sites More sharing options...
BIGAL Posted November 17, 2021 Share Posted November 17, 2021 Glad to help. If you get stuck doing next step just ask. 1 Quote Link to comment Share on other sites More sharing options...
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.