Concentric Circles example

We will show a simple example how LISP can ease and speed up the work by hundred or more times.

Let’s say that you have to draw 1000 concentric circles so that each circle has radius bigger for a specific value (step).

You would do this task without LISP for a few hours.

By using LISP function CCIRC (concentric circles) in the command window, you will do this task in less than a second.

;ccirc.lsp

;

;author: Mirza Coralic

;

;draw concentric circles with specified radius step

;

(defun c:ccirc(/ cp radius step)

(setq cp (getpoint "Specify circle center: "))

(setq step (getreal "Specify radius step: "))

(setq radius step)

(repeat 1000

(command "circle" cp radius)

(setq radius (+ radius step))

)

(princ)

)

Download the ccirc.lsp file.

Save the LISP function in “ccirc.lsp” file and load the file in BabaCAD with the command APPLOAD only once during the work.

When you want to start it, just type CCIRC in the command window and press Enter. Whole function is shown below.