Lisp option malfunction
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi guys, i am traying to get this quick update lisp to work but do not know what I am missing.
I want the lisp to give me the option to pick what option i want it to execute. This is what i got so far , i am kinda new to writing lisp.
(defun c:quick update ( / ans do_A do_B)
(defun do_A)
(foreach layout (layoutlist)
(setvar "ctab" layout)
(command ".-ATTEDIT" "N" "N" "*" "06" "*" "value" "value")
(command ".-ATTEDIT" "N" "N" "*" "R2A" "*" "" "value")
(command ".-ATTEDIT" "N" "N" "*" "R2B" "*" "" "value")
);foreach)
(defun do_B)
(foreach layout (layoutlist)
(setvar "ctab" layout)
(command ".-ATTEDIT" "N" "N" "*" "R2D" "*" "" "name")
(command ".-ATTEDIT" "N" "N" "*" "R2E" "*" "" "name")
(command ".-ATTEDIT" "N" "N" "*" "R2F" "*" "" "name")
(command ".-ATTEDIT" "N" "N" "*" "R2G" "*" "" "name")
(command "zoom" "e")
);foreach
;; then use getkword...
(initget "1" "2")
(setq ans (getkword "\nSelect a topping [1/2/] <1: "))
(cond
((or (not ans)(= ans "1"))(do_A))
((= ans "2")(do_B))
);end_defun