DEFUN C:GRSET7
;SET LAYER
(COMMAND "SETVAR" "CMDECHO" 0)
(SETQ NY (GETVAR "CLAYER"))
;(IF (= (TYPE F1) 'FILE ) "YES"  (STOP))
;(IF (= (TYPE F2) 'FILE ) "YES" (STOP))
(setq G7SET (findfile "/ACAD/HON/SET/G7.SET"))
(IF (= G7SET NIL)
    (PROGN
       (PROMPT "\nPLEASE SETTING LAYER IN GROUP 7:" )
       (SETQ FC (OPEN "/ACAD/HON/SET/G7.SET" "w"))
       (SETQ G7NUM (GETINT"\nHOW MANY LAYERS DO YOU WANT IN GROUP 7:"))
       (WRITE-LINE (ITOA G7NUM) FC)
       (SETQ ORDER 0)
       (REPEAT G7NUM
          (SETQ ORDER (+ ORDER 1))
          (SETQ ORDER1 (STRCAT (ITOA ORDER) "TH"))
          (PROMPT"\nKEYIN LAYER NAME:<")(PROMPT ORDER1)(PROMPT">")
          (SETQ G7LAY (GETSTRING T))
          (IF (= G7LAY "")
              (WRITE-LINE "" FC)
              (WRITE-LINE G7LAY FC)
          )
       )
       (CLOSE FC)
    )
)

 (IF (/= G7SET NIL)
     (PROGN
        (SETQ FC (OPEN "/ACAD/HON/SET/G7.SET" "r"))
        (SETQ G7NUM (READ-LINE FC))
;       (SETQ G7LAY (READ-LINE FC))
        (IF (OR (= G7NUM "") (= G7NUM NIL))
            (PROGN
               (CLOSE FC)
               (COMMAND G7)
            )
        )
       (IF (OR (= G7NUM NIL) (= G7NUM NIL))
         (PROGN
           (PROMPT "\nPLEASE SETTING LAYER IN GROUP 7:" )
           (SETQ FC (OPEN "/ACAD/HON/SET/G7.SET" "w"))
           (SETQ G7NUM (GETINT"\nHOW MANY LAYERS DO YOU WANT IN GROUP 7:"))
           (WRITE-LINE (ITOA G7NUM) FC)
           (SETQ ORDER 0)
           (REPEAT G7NUM
              (SETQ ORDER (+ ORDER 1))
              (SETQ ORDER1 (STRCAT (ITOA ORDER) "TH"))
              (PROMPT"\nKEYIN LAYER NAME:<")(PROMPT ORDER1)(PROMPT">")
              (SETQ G7LAY (GETSTRING T))
              (IF (= G7LAY "")
                  (WRITE-LINE "" FC)
                  (WRITE-LINE G7LAY FC)
              )
           )
           (CLOSE FC)
         )
       )
        (IF (/= G7NUM NIL)
           (PROGN
              (SETQ FC (OPEN "/ACAD/HON/SET/G7.SET" "r"))
              (SETQ G7NUM (READ-LINE FC))
              (PROMPT"\nGROUP 7 LAYERS HAVE:")
              (PROMPT "<" )
              (SETQ G7NUM (ATOI G7NUM))
              (SETQ FY1 "")
              (SETQ FY "")
              (REPEAT G7NUM
                 (SETQ G7LAY (READ-LINE FC))
                 (SETQ FY (STRCAT G7LAY "," FY))
                 (SETQ FY1 FY)
                 (PROMPT G7LAY)(PROMPT"  ")
                 (IF (= G7LAY "")
                     (PROGN
                       (COMMAND "G7")
                       (SETQ G7NUM 0)
                     )
                 )
              )
              (PROMPT">")
           (CLOSE FC)
           )
        )
     )
 )

;(COMMAND "LAYER" "FREEZE" FY "")

(SETQ ANS (strcase (GETSTRING "\nDO YOU WANT TO CHANGE LAST SETTING <Y/N> N:")))
 (IF (= ANS "Y")
     (PROGN
       (PROMPT "\nPLEASE SETTING LAYER IN GROUP 7:" )
       (SETQ FC (OPEN "/ACAD/HON/SET/G7.SET" "w"))
       (PROMPT"\nHOW MANY LAYERS DO YOU WANT IN GROUP 7:")
       (PROMPT"<")(PRIN1 G7NUM)(PROMPT">")
       (SETQ G7NUMN G7NUM)
       (SETQ G7NUM (GETINT))
       (IF (OR (= G7NUM "") (= G7NUM NIL))
           (WRITE-LINE (ITOA G7NUMN) FC)
           (WRITE-LINE (ITOA G7NUM) FC)
       )
       (SETQ ORDER 0)
       (IF (OR (= G7NUM "") (= G7NUM NIL))
           (SETQ G7NUM G7NUMN)
       )
       (REPEAT G7NUM
          (SETQ ORDER (+ ORDER 1))
          (SETQ ORDER1 (STRCAT (ITOA ORDER) "TH"))
          (PROMPT"\nKEYIN LAYER NAME:<")(PROMPT ORDER1)(PROMPT">")
          (SETQ G7LAY (GETSTRING T))
          (IF (= G7LAY "")
              (WRITE-LINE "" FC)
              (WRITE-LINE G7LAY FC)
          )
       )
       (CLOSE FC)
     )
 )

