this lisp is used to distribute sprinkler inside room .this lisp ask for block name which is always "S"
and ask for number of x which is the difference between( x2-x1 )/4600 with bigger integer as if it's equal 2.1 it will be 3 ans so on
ask for number of y which is the difference between( y2-y1 )/4600 with bigger integer as if it's equal 2.1 it will be 3 ans so on
so how to modify this lisp to do it automatically
(PROMPT "\n THIS PROGRAM FOR DISTRIBUTION LAMP")
(PROMPT "\n START COMMAND by : ----DIL---- ")
(DEFUN CIL ()
(SETVAR "CMDECHO" 0)
(setq os (getvar "osmode"))
(setvar "osmode" 0)
(SETQ P1 (GETPOINT "\n ENTER FIRST POINT: "))
(SETQ P3 (GETPOINT "\n ENTER SECOND POINT: "))
(SETQ BB1 (GETSTRING "\n ENTER BLOCK NAME"))
(setq x1 (car p1))
(setq y1 (car (cdr p1)))
(setq x3 (car p3))
(setq y3 (car (cdr p3)))
(setq p2 (list x1 y3))
(setq p4 (list x3 y1))
(setq disx (distance p1 p4))
(setq disy (distance p1 p2))
(SETQ NX (GETINT "\n NUMBER OF X DIR."))
(SETQ XXN (/ disx (* NX 2)))
(SETQ DS1 (* XXN 2))
(SETQ NY (GETINT "\n NUMBER OF Y DIR."))
(SETQ YYN (/ disy (* NY 2)))
(SETQ DS2 (* YYN 2))
(setq xx1 (+ (car p1) XXN))
(setq yy1 (+ (car (cdr p1)) YYN))
(setq pp2 (list xx1 yy1))
(COMMAND "-layer" "m" "M-FIRE-SYMB-P" "c" "2" "" "")
(COMMAND "INSERT" BB1 pp2 "" "" "")
;(COMMAND "ARRAY" "L" "" "R" NY NX DS2 DS1)
(if (eq NX 1) (COMMAND "ARRAY" "L" "" "R" NY NX DS2))
(if (eq NY 1) (COMMAND "ARRAY" "L" "" "R" NY NX DS1))
(if (AND (/= NX 1) (/= NY 1))(COMMAND "ARRAY" "L" "" "R" NY NX DS2 DS1))
(setvar "osmode" os)
(PRIN1)
(PRIN1)
(PROMPT "\n")
(PROMPT "\n CREATED by :")
(PROMPT "\n ********* M.SAIED. ********* ")
(PRINC)
);DEFUN