I gave some bad advice there regarding 'cond' or rather didn't explain how to use it:
EDIT: I forgot that list boxes don't output a string but rather a numerical value in string format ("0", "1") of the user's selection. I *think* the list with start with '0' you'll have to verify though. That was Kenny's reason for using atof but you can use cond instead. He converts the value returned by 'get_tile' from the list box into an integer so that it can be used with the 'nth' function on the same list used to fill the list box. Cond will work just fine for shorter lists but is a lot of code for longer lists.
(cond
((= SIZ "0") (setvar "dimscale" 1)) ;;; for "1\"
((= SIZ "1") (setvar "dimscale" 2)) ;;; for "6\" = 1'-0\""
((= SIZ "2") (setvar "dimscale" 4)) ;;; for "3\" = 1'-0\""
((= SIZ "3") (setvar "dimscale"
)
((= SIZ "4") (setvar "dimscale" 12))
((= SIZ "5") (setvar "dimscale" 16))
((= SIZ "6") (setvar "dimscale" 24))
((= SIZ "7") (setvar "dimscale" 48))
)
Note that I never use dimscale (I use annotative stuff) so make sure you enter the numbers you actually want in the variables. Remember that with simple lines of code (and even not-so-simple lines of code) you can plug your code, line by line (or function by function, just double-lick the parenthesis to highlight the function, into the visual LISP console and test it out.
test out (atof "6\" = 1'-0\"") in your visual LISP console window (or even the command line within AutoCAD itself) and you'll see what I mean. ATOF cannot convert a text string that contains characters other than 0123456789 "." and maybe comma's but I'd have to test that out.
Cond is really just a better, more powerful "if" function.
See this link on Afralisp for cond (near the end of the tutorial:
https://www.afralisp.net/autolisp/tutorials/conditionals.phpAnd Autodesk help on ATOF:
https://documentation.help/AutoLISP-Functions/WS1a9193826455f5ff1a32d8d10ebc6b7ccc-6aa0.htmSub functions: Maybe shove that part of my last post aside for now. I should have deleted that in hindsight. The only reason I mentioned that is because it might come up in the future where you can't execute a certain function from within the action_tile itself, or while the dialog is loaded; you have to close the dialog. But you can always set a 'flag' and have that trigger something after the dialog is unloaded. Here's afralisp's page on the 'define function function':
https://www.afralisp.net/autolisp/tutorials/the-define-function.phpSee if you can get that cond to work if not post your code and I'll actually have a go at it.