tk2
15th Aug 2005, 03:03 pm
alright, I need some help with writting some code since this is my first time using autoLISP (it's for a summer project i've been working on). I posted a question earlier about the ucs and circle commands but I think I need to reword it.
I guess what I want to know is how to use the commands with variables.
Here is an example of what I know how to do:
(defun c:circle()
(command "circle" "2,2,2" "4"))
which of course will draw a circle at (2,2,2) with a radius of 4, which is great if all I needed to do was draw one circle...but I'm guessing there is a way to draw as many circle's as I want while changine the location and radius if i want to but I can't seem to figure out how.
for example, I've tried the following but they obviously don't work:
(defun c:circle()
(setq a 2)
(command "circle" "a,a,a" "4"))
or
(defun c:circle()
(setq a 2)
(command "circle" list(a a a) "4"))
or
(defun c:circle()
(setq a 2)
(repeat 4 (setq a (+ a 1))
(command "circle" "2,2,2" a)))
plus many other ways of trying to write it with and without quotations. so what I'm getting at is that I obviously am missing some of the fundamentals of how autoLISP works. if someone could explain how I could use this command with a variable, or more specifically with a changing variable I would really appreciate it!
thanks
troy
I guess what I want to know is how to use the commands with variables.
Here is an example of what I know how to do:
(defun c:circle()
(command "circle" "2,2,2" "4"))
which of course will draw a circle at (2,2,2) with a radius of 4, which is great if all I needed to do was draw one circle...but I'm guessing there is a way to draw as many circle's as I want while changine the location and radius if i want to but I can't seem to figure out how.
for example, I've tried the following but they obviously don't work:
(defun c:circle()
(setq a 2)
(command "circle" "a,a,a" "4"))
or
(defun c:circle()
(setq a 2)
(command "circle" list(a a a) "4"))
or
(defun c:circle()
(setq a 2)
(repeat 4 (setq a (+ a 1))
(command "circle" "2,2,2" a)))
plus many other ways of trying to write it with and without quotations. so what I'm getting at is that I obviously am missing some of the fundamentals of how autoLISP works. if someone could explain how I could use this command with a variable, or more specifically with a changing variable I would really appreciate it!
thanks
troy