DEFUN C:SET9
;SET LAYER
(COMMAND "SETVAR" "CMDECHO" 0)
;(IF (= (TYPE F1) 'FILE ) "YES"  (STOP))
;(IF (= (TYPE F2) 'FILE ) "YES" (STOP))
(setq SET9 (findfile "/ACAD/HON/SET/SET9.SET"))
(IF (= SET9 NIL)
    (PROGN
       (PROMPT "\nPLEASE SETTING LAYER:" )
       (SETQ FC (OPEN "/ACAD/HON/SET/SET9.SET" "w"))
       (setq SETL9 (GETSTRING T"\nSETTING LAYER ? <9>:"))
       (IF (OR (= SETL9 "") (= SETL9 NIL))
              (WRITE-LINE "9" FC)
              (WRITE-LINE SETL9 FC)
       )
       (CLOSE FC)
    )
)

(IF (/= SET9 NIL)
    (PROGN
       (SETQ FC (OPEN "/ACAD/HON/SET/SET9.SET" "r"))
       (SETQ SETL9 (READ-LINE FC))
       (IF (OR (= SETL9 "") (= SETL9 NIL))
           (CLOSE FC)
       )
       (IF (OR (= SETL9 "") (= SETL9 NIL))
           (PROGN
              (PROMPT "\nPLEASE SETTING LAYER:" )
              (SETQ FC (OPEN "/ACAD/HON/SET/SET9.SET" "w"))
              (setq SETL9 (GETSTRING T"\nSETTING LAYER ? <9>:"))
              (IF (= SETL9 "")
                  (WRITE-LINE "9" FC)
                  (WRITE-LINE SETL9 FC)
              )
           (CLOSE FC)
           )
       )
       (SETQ FC (OPEN "/ACAD/HON/SET/SET9.SET" "r"))
       (SETQ SETL9 (READ-LINE FC))
       (CLOSE FC)
       (PROMPT "\nLAYER NAME IS:" )(PROMPT SETL9)(TERPRI)
    )
)

(SETQ ANS (strcase (GETSTRING "\nDO YOU WANT TO CHANGE LAST SETTING <Y/N> N:")))
(IF (= ANS "Y")
    (PROGN
       (PROMPT "\nPLEASE SETTING LAYER:" )
       (SETQ FC (OPEN "/ACAD/HON/SET/SET9.SET" "w"))
       (PROMPT "\nLAYER IS " )(PROMPT "<")(PROMPT SETL9) (PROMPT ">:")
       (SETQ SETW9 SETL9)
       (setq SETL9 (GETSTRING T))
       (IF (OR (= SETL9 "") (= SETL9 NIL))
               (WRITE-LINE SETW9 FC)
               (WRITE-LINE SETL9 FC)
       )
       (CLOSE FC)
       (SETQ FC (OPEN "/ACAD/HON/SET/SET9.SET" "r"))
       (SETQ SETL9 (READ-LINE FC))
       (CLOSE FC)
       (PROMPT "\nLAYER NOW IS:" )(PROMPT SETL9)(TERPRI)
  )
)
