lisp49af :dialog {label="tabs";
:list_box {key="lb1";label="Select Bolt Type:";
allow_accept=true; tabs="8 16 24";
list="M20\t40LG\tGr. 8,8;\nM16\t30LG\tGr. 4,6;\nM30\t60LG\tGr. 8,8;\nM12\t35LG\tGr. 4,6;\nM8\t45LG\tGr. 8,8";
height=6;fixed_height=true;}
ok_cancel;
}
it seems its important for this code to work everything on line 4 is on the same line
alternatively you can pass the list to the dialog thru the lisp program because now the list will always be the same but what if you don't know how long your list is gonna be? look at : https://autolisp-exchange.com/Tutorials/MyDialogs.htm
Somewhere in the middle of the page is an example called 'My Multi Lists'
//---------------------------------------------------------------------------------------------------------
// MyMultiLists
//---------------------------------------------------------------------------------------------------------
MyMultiLists : dialog {
key = "Title";
label = "";
: boxed_column {
label = "Select an Item";
: list_box {
key = "List1";//Value1$ from lsp file
height = 6.27;
fixed_height = true;
width = 32.92;
fixed_width = true;
}
spacer;
}
: boxed_column {
label = "Multi Select Items";
: list_box {
multiple_select = true;
key = "List2";//Value2$ from lsp file
height = 6.27;
fixed_height = true;
width = 32.92;
fixed_width = true;
}
spacer;
}
spacer;
ok_only;
}//MyMultiLists
;----------------------------------------------------------------------------------------------------------
; c:MyMultiLists - Dialog for list_boxes with single and multi select examples
; Syntax: MyMultiLists
;----------------------------------------------------------------------------------------------------------
(defun c:MyMultiLists (/ Dcl_Id% List1@ List2@ Return# Value1$ Value2$)
(princ "\nMyMultiLists")(princ)
; Set Default Variables
(if (not *MyMultiLists@);Unique global variable name to store dialog info
(setq *MyMultiLists@ (list nil "" ""))
);if
(setq Value1$ (nth 1 *MyMultiLists@)
Value2$ (nth 2 *MyMultiLists@)
List1@ (list "Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday")
List2@ (list "January" "February" "March" "April" "May" "June" "July" "August"
"September" "October" "November" "December")
);setq
; Load Dialog
(setq Dcl_Id% (load_dialog "MyDialogs.dcl"))
(new_dialog "MyMultiLists" Dcl_Id%)
; Set Dialog Initial Settings
(set_tile "Title" " My Multi Lists")
(set_tile_list "List1" List1@ Value1$);*Included
(set_tile_list "List2" List2@ Value2$);*Included
; Dialog Actions
(action_tile "List1" "(set_list_value \"List1@\" \"Value1$\")");*Included
(action_tile "List2" "(set_multilist_value \"List2@\" \"Value2$\")");*Included
(setq Return# (start_dialog))
; Unload Dialog
(unload_dialog Dcl_Id%)
(setq *MyMultiLists@ (list nil Value1$ Value2$))
(princ)
);defun c:MyMultiLists
here you have ': list_box { key = "List1"; //Value1$ from lsp file' , which means this listbox will be filled by the program later on
The lisp program does so by first creating a list called 'List1@'
(setq List1@ (list "Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday")
and later it fills the listbox with :
(set_tile_list "List1" List1@ Value1$) where Value1$ was set to "" earlier.
Just study and play with the examples on the autocad-exchange link , they can do a far better job than me explaining