Message 1 of 5

Not applicable
04-09-2020
12:04 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I'm very beginner in autolisp, and I need a help.
I'm making a lisp, that when I click the number, the function 'call' block from the relative path.
How is it possible when I click "End!", to go to the certain function, without writing 100+ more line code.
Do I need if function, or something like that?
(defun c:c4x6 ()
(setq insertpt1 (getpoint "\nChoose point: "))
(command "_insert" "./_blokovi/kabl4x6.dwg" insertpt1 "" "" "")
(setq input "1" vlakno1 "1 2 3 4 5 6 End!")
(progn
(initget vlakno1)
(setq input (cond ((getkword (strcat "\nNumber in 1. coulmn?: [" (vl-string-translate " " "/" vlakno1) "] <" input ">: "))) (input))))
(apply (read (strcat "c:e" input)) nil)
(setq input "1" vlakno2 "1 2 3 4 5 6 End!")
(progn
(initget vlakno2)
(setq input (cond ((getkword (strcat "\nNumber in 2. coulmn?: [" (vl-string-translate " " "/" vlakno2) "] <" input ">: "))) (input))))
(apply (read (strcat "c:f" input)) nil)
.
.
.
;etc.
(defun c:e1 ()
(setq insertpt1 (getpoint "\nChoose point: "))
(command "_insert" "./_blokovi/1vlakno.dwg" insertpt1 "" "" "")
(princ)
)
(defun c:e2 ()
(setq insertpt1 (getpoint "\nChoose point: "))
(command "_insert" "./_blokovi/2vlakno.dwg" insertpt1 "" "" "")
(princ)
)
.
.
(defun c:f1 ()
(setq insertpt1 (getpoint "\nChoose point: "))
(command "_insert" "./_blokovi/2vlakno.dwg" insertpt1 "" "" "")
(princ)
)
.
.
Solved! Go to Solution.