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

(IF (/= SET2 NIL)
    (PROGN
       (SETQ FC (OPEN "/ACAD/HON/SET/SET2.SET" "r"))
       (SETQ SETL2 (READ-LINE FC))
       (IF (OR (= SETL2 "") (= SETL2 NIL))
           (CLOSE FC)
       )
       (IF (OR (= SETL2 "") (= SETL2 NIL))
           (PROGN
              (PROMPT "\nPLEASE SETTING LAYER:" )
              (SETQ FC (OPEN "/ACAD/HON/SET/SET2.SET" "w"))
              (setq SETL2 (GETSTRING T"\nSETTING LAYER ? <2>:"))
              (IF (= SETL2 "")
                  (WRITE-LINE "2" FC)
                  (WRITE-LINE SETL2 FC)
              )
           (CLOSE FC)
           )
       )
       (SETQ FC (OPEN "/ACAD/HON/SET/SET2.SET" "r"))
       (SETQ SETL2 (READ-LINE FC))
       (CLOSE FC)
       (PROMPT "\nLAYER NAME IS:" )(PROMPT SETL2)(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/SET2.SET" "w"))
       (PROMPT "\nLAYER IS " )(PROMPT "<")(PROMPT SETL2) (PROMPT ">:")
       (SETQ SETW2 SETL2)
       (setq SETL2 (GETSTRING T))
       (IF (OR (= SETL2 "") (= SETL2 NIL))
               (WRITE-LINE SETW2 FC)
               (WRITE-LINE SETL2 FC)
       )
       (CLOSE FC)
       (SETQ FC (OPEN "/ACAD/HON/SET/SET2.SET" "r"))
       (SETQ SETL2 (READ-LINE FC))
       (CLOSE FC)
       (PROMPT "\nLAYER NOW IS:" )(PROMPT SETL2)(TERPRI)
  )
)
