Search the Community
Showing results for tags 'generate'.
Found 2 results
I have been experimenting with generating variables through code rather than defining them manually. The problem is that when the program creates them, they are defined as global variables. Is there a way to generate them as local variables instead? Below is the sample code that I wrote for testing it. ;ListToVariables creates variables named testvar0, testvar1, testvar2, etc. ;Each newly created variable contains the contents of the correlated slot from testlist. (defun c:test ( / testlist ) (setq testlist (list "aaa" "bbb" "ccc" "ddd" "eee")) (ListToVariables testlist) ) (defun ListToVariables ( listname / i ) (setq i 0) (repeat (length listname) (set (read (strcat "testvar" (rtos i 2 0))) (nth i listname)) (setq i (1+ i)) ) (princ) )
hey guys i have a file with 2 dozen layers each with objects in 12 different colors and i need to sort them out into layers depending on the objects color. e.g. all the objects with color "yellow" in one layer, all the objects with color "magenta" in another layer etc. can this be done with a lisp? can anyone help me i now nothing about writing lisp's