Multiple Radio Buttons
Multiple Radio Buttons is a library routine that allows you to create as many Buttons of input as required (subject to Autocad limits) using a dialouge rather than the command line.
You can have horizontal or vertical buttons choice is yours
Its use is intended where you want the user to pick one only of preset values it can be a number, a character or a whole word.
It can be used in most lisp code with just a couple of lines of code, compared to a hard coded solution of around 50+ lines repeated every time you want to use a dcl.
To use just save the "Multi Radio Buttons.lsp" to a directory that is included in you Autocad search path. If you need more information how to do this send an email to email@example.com
It only requires 3 lines of code in any lisp to use.
(if (not AH:Butts)(load "Multi radio buttons.lsp")) ; loads the program if not loaded already
(if (= but nil)(setq but 1)) ; this is needed to set default button for user pick
(setq ans (ah:butts but "V" '("A B C D " "A" "B" "C" "D" ))) ; V is for vertical H for horizontal layout
In the example above the variable ans will have the button string value.
(setq ans (ah:butts but "V" '("Please choose " "Alpha" "Beta" "1" "2" "No words")))
Pick button 5 ans = "No words"
The program resets the default button to last pick so click Ok, can be removed if not required.
Copy the 3 lines above to your command line to see how it works. There is extra examples in the top of the code how to use in your code.
For programmers it is a replacement for the Initget function.
If you want further information or conversion of your code email firstname.lastname@example.org