TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: kruuger on September 04, 2012, 07:11:32 AM
-
hello,
please see attached code and image below.
is there any better way to improve coding for this dialog ?
especially for action_tile "IMx", function _UpdateImageButton and variable *im *or *by.
is code a little bit clear for you, how all things work together or definitely need rework ?
thank you
kruuger
-
usually, I wrap this code in 'foreach
(action_tile "IM1" "(setq *im (cd:LST_ReplaceItem 0 *im (abs (- 1 (nth 0 *im)))) *or (abs (- 1 (nth 0 *im))) *by 0) (_UpdateImageButton)") (action_tile "IM2" "(setq *im (cd:LST_ReplaceItem 2 *im (abs (- 1 (nth 2 *im)))) *or (abs (- 1 (nth 2 *im))) *by 1) (_UpdateImageButton)") (action_tile "IM3" "(setq *im (cd:LST_ReplaceItem 4 *im (abs (- 1 (nth 4 *im)))) *or (abs (- 1 (nth 4 *im))) *by 2) (_UpdateImageButton)")
-
thanks Evgeniy
it seems that it should work but error ?
(setq *im
(cd:LST_ReplaceItem
(* 2 %) *im
(abs (- 1 (nth (* 2 %) *im
)))) *by %
)
(_UpdateImageButton)
)
)
)
)
)
kruuger
-
The symbol '%' won't be evaluated inside the quoted expression.
-
thanks Lee. is there any way to fix this or need to play with strcat
"(setq *im (cd:LST_ReplaceItem (* 2 " (itoa %) ") *im (abs (- 1 (nth (* 2 " (itoa %) ") *im))))" " *or (abs (- 1 (nth (* 2 " (itoa %) ") *im)))" "(_UpdateImageButton)"
)
)
)
kruuger
-
Maybe not better, but find attached my thoughts on a different way to code it. :-)
-
Maybe not better, but find attached my thoughts on a different way to code it. :-)
thanks Lee. it is good to see the different approach :-)
kruuger
-
You're welcome kruuger, hope it helps :-)