 ; Bic - place lights in a space
 ; Copyright 1997 by Rocket Software
 ; Before generating any information, ask what use it will be.
 ; If nobody knows, ask for a promotion.
 (DEFUN C:BIC (/ pa pb xdis ydis rows cols rowdis coldis px py rowlis collis
                                                colptx num rowpty pta ptlist)
  (setq pa (getpoint "\nCorner of space: "))
  (setq pb (getcorner pa "\nOther corner: "))
  (setq xdis (- (car pb) (car pa)))
  (setq ydis (- (cadr pb) (cadr pa)))
  (setq rows (getint "\nNumber of rows: "))
  (setq cols (getint "\nNumber of columns: "))
  (setq rowdis (/ ydis rows))
  (setq coldis (/ xdis cols))
  (setq px (+ (car pa) (/ coldis 2)))
  (setq collis (list px))
  (repeat (1- cols)
          (setq collis (append collis (list (setq px (+ px coldis))))))
  (setq py (+ (cadr pa) (/ rowdis 2)))
  (setq rowlis (list py))
  (repeat (1- rows)
          (setq rowlis (append rowlis (list (setq py (+ py rowdis))))))
  (while (setq colptx (car collis))
         (setq collis (cdr collis))
         (setq num 0)
         (while (setq rowpty (nth num rowlis))
                (setq num (1+ num))
                (setq pta (list colptx rowpty))
                (setq ptlist (append ptlist (list pta)))))
  (setq num 0)
  (while (setq pta (nth num ptlist))
         (setq num (1+ num))
         (command ".insert" "pendant-light" pta (getvar "dimscale") "" 0))
 (princ))