Message 1 of 6
Creating incremental variables in AutoLISP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
In the example below I ask the user to enter a value and is given continuity to the code...
(defun c:Test () (setq lista '(1)) (setq n_forcas (cond ((getint "\nnumber of variables <1>: ")) (1))) (if (> n_forcas 0) (progn (cond ((= n_forcas 1) (progn (setq f1 (getint "\variables 1: ")) )) ((= n_forcas 2) (progn (setq f1 (getint "\variables 1: ")) (setq f2 (getint "\variables 2: ")) )) ) ) (Alert "Invalid Input!") ) (princ) )
but I would like to create a variable that I could incremental, for example:
(setq n_forcas (cond ((getint "\ nnumber of variables <1>:"))
(1)))
if I type 1 it will create
(setq f1 (getint "\ variables 1:"))
if I type 2 it will create
(setq f1 (getint "\ variables 1:"))
(setq f2 (getint "\ variables2:"))
if I type 3 it will create
(setq f1 (getint "\ variables 1:"))
(setq f2 (getint "\ variables2:"))
(setq f3 (getint "\ variables3:"))
(1)))
if I type 1 it will create
(setq f1 (getint "\ variables 1:"))
if I type 2 it will create
(setq f1 (getint "\ variables 1:"))
(setq f2 (getint "\ variables2:"))
if I type 3 it will create
(setq f1 (getint "\ variables 1:"))
(setq f2 (getint "\ variables2:"))
(setq f3 (getint "\ variables3:"))
4, 5, 6 [...]
Is it possible or not?
Is it possible or not?