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

 (IF (/= G1SET NIL)
     (PROGN
        (SETQ FC (OPEN "/ACAD/HON/SET/G1.SET" "r"))
        (SETQ G1NUM (READ-LINE FC))
        (IF (OR (= G1NUM "") (= G1NUM NIL))
            (PROGN
               (CLOSE FC)
               (COMMAND G1)
            )
        )
       (IF (OR (= G1NUM NIL) (= G1NUM NIL))
         (PROGN
           (PROMPT "\nPLEASE SETTING LAYER IN GROUP 1:" )
           (SETQ FC (OPEN "/ACAD/HON/SET/G1.SET" "w"))
           (SETQ G1NUM (GETINT"\nHOW MANY LAYERS DO YOU WANT IN GROUP 1:"))
           (WRITE-LINE (ITOA G1NUM) FC)
           (SETQ ORDER 0)
           (REPEAT G1NUM
              (SETQ ORDER (+ ORDER 1))
              (SETQ ORDER1 (STRCAT (ITOA ORDER) "TH"))
              (PROMPT"\nKEYIN LAYER NAME:<")(PROMPT ORDER1)(PROMPT">")
              (SETQ G1LAY (GETSTRING T))
              (IF (= G1LAY "")
                  (WRITE-LINE "" FC)
                  (WRITE-LINE G1LAY FC)
              )
           )
           (CLOSE FC)
         )
       )
        (IF (/= G1NUM NIL)
           (PROGN
              (SETQ FC (OPEN "/ACAD/HON/SET/G1.SET" "r"))
              (SETQ G1NUM (READ-LINE FC))
              (SETQ G1NUM (ATOI G1NUM))
              (SETQ FY1 "")
              (SETQ FY "")
              (SETQ LAN (GETSTRING"\nCHANGE TO ?"))
              (PROMPT"\nALL GROUP 1 LAYERS WILL BE CHANGE TO:")
              (PROMPT LAN )
              (PROMPT"\n<")
              (REPEAT G1NUM
                 (SETQ G1LAY (READ-LINE FC))

                 (SETQ MAX (GETVAR "EXTMAX"))
                 (SETQ MIN (GETVAR "EXTMIN"))
                 (COMMAND "SELECT" "CROSSING" MIN MAX "")
                 (SETQ LA G1LAY)
                 (SETQ SA (SSGET "X" (LIST (CONS 8 LA))))
                 (IF (/= SA NIL)
                     (PROGN
                       (SETQ S1 SA)
                       (IF SA (COMMAND "CHANGE" SA "" "P" "COLOR" "BYLAYER" "LT" "BYLAYER" "LA" LAN ""))
                       (SETQ SA NIL)
                     )
                 )
                 (SETQ FY (STRCAT G1LAY "," FY))
                 (SETQ FY1 FY)
                 (PROMPT G1LAY)(PROMPT"  ")
                 (IF (= G1LAY "")
                     (PROGN
                       (COMMAND "G1")
                       (SETQ G1NUM 0)
                     )
                 )
              )
              (PROMPT">")
           (CLOSE FC)
           )
        )
     )
 )
