You really need to Wrap Code tags around any code you post.
Clicking the [Go Advanced] button at the bottom puts a toolbar at the top and the # icon in that toolbar places code tags around selected text for you or simply paste your code inside.
Untested, but try:
Code:
(defun C:LRR ( / ent obj c1 c2 wid ht rows cols blk); = Lights in Rectangular [& orthogonal] Room
(if (setq ss (ssget "+.:E:S" '((0 . "*POLYLINE"))))
(progn
(setq ent (ssname ss 0)
obj (vlax-ename->vla-object ent)
); setq
(vla-GetBoundingBox obj 'minpt 'maxpt)
(setq c1 (vlax-safearray->list minpt)
c2 (vlax-safearray->list maxpt)
rows (getint "\nNumber of rows (---): ")
cols (getint "\nNumber of columns (|||): ")
wid (/ (- (car c2) (car c1))cols)
ht (/ (- (cadr c2) (cadr c1))rows)
blk (cdr (assoc 2 (entget (car (entsel "\n Select Block")))))
c1 (list(+(car c1)(/ wid 2))(+(cadr c1)(/ ht 2)))
); setq
(command "_.minsert" blk c1 "" "" "" rows cols ht wid); command
); progn
); if
(princ)
); defun