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

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