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

 (IF (/= G5SET NIL)
     (PROGN
        (SETQ FC (OPEN "C:/ACAD/ACAD/SUPPORT/G5.SET" "r"))
        (SETQ G5NUM (READ-LINE FC))
        (IF (OR (= G5NUM "") (= G5NUM NIL))
            (PROGN
               (CLOSE FC)
               (COMMAND "G5")
            )
        )
        (IF (/= G5NUM NIL)
           (PROGN
              (SETQ G5NUM (ATOI G5NUM))
              (SETQ FY5 "")
              (SETQ FY "")
              (REPEAT G5NUM
                 (SETQ G5LAY (READ-LINE FC))
                 (SETQ FY (STRCAT G5LAY "," FY))
                 (SETQ FY5 FY)
                 (PROMPT "\n" )(PROMPT G5LAY)
                 (IF (= G5LAY "")
                     (PROGN
                       (COMMAND "G5")
                       (SETQ G5NUM 0)
                     )
                 )
              )
           )
        )
     )
 )
