New user here. I'm using the student lisenced version of AutoCAD 2014 for Mac. Because Mac has no VisualLISP with the AutoCAD package, I'm using an app called Text Wrangler to create .lsp files for AutoCAD. Here is the code I am trying to use:
(defun c:circleseries ()
(setq N (getint "\n How many circles?: "))
(setq a (getreal "\n Angle at which circles will be drawn: "))
(setq cp1 (getpoint "\n Specify center point of first circle: "))
(setq r (getreal "\n Specify the radius: "))
(setq cpx (polar cp1 a (* 3 r)))
(setq x 0)
(command "circle" cp1 r "")
(while (< x N)
(command "circle" cpx r "")
(setq cpx (polar cpx a (* 3 r))))
)
After uploading this code using appload, the program works just fine. However, after the program finishes I encounter a problem: AutoCAD sends an error message stating: Unknown command "circleseries". Press F1 for help. It displays this message an infinite amount of times, freezing AutoCAD so I cannot do anything. Please let me know the problem, whether its a glitch with the software itself or just my program. Thanks in advance.
bdeanc, welcome to the Autodesk Forums!
try this modified code
(defun c:circleseries (/ A CP1 CPX N R X);; localized variables (setq N (getint "\n How many circles?: ")) (setq a (getreal "\n Angle at which circles will be drawn: ")) (setq cp1 (getpoint "\n Specify center point of first circle: ")) (setq r (getreal "\n Specify the radius: ")) (setq cpx (polar cp1 a (* 3 r))) (setq x 0) (command "circle" cp1 r);; removed "" (while (< x N) (command "circle" cpx r);; removed "" (setq cpx (polar cpx a (* 3 r))) (setq x (1+ x));; added ) (princ);; quiet exit )
HTH
Henrique