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

 (IF (/= G10SET NIL)
     (PROGN
        (SETQ FC (OPEN "/ACAD/HON/SET/G10.SET" "r"))
        (SETQ G10NUM (READ-LINE FC))
;       (SETQ G10LAY (READ-LINE FC))
        (IF (OR (= G10NUM "") (= G10NUM NIL))
            (PROGN
               (CLOSE FC)
               (COMMAND G10)
            )
        )
       (IF (OR (= G10NUM NIL) (= G10NUM NIL))
         (PROGN
           (PROMPT "\nPLEASE SETTING LAYER IN GROUP 10:" )
           (SETQ FC (OPEN "/ACAD/HON/SET/G10.SET" "w"))
           (SETQ G10NUM (GETINT"\nHOW MANY LAYERS DO YOU WANT IN GROUP 10:"))
           (WRITE-LINE (ITOA G10NUM) FC)
           (SETQ ORDER 0)
           (REPEAT G10NUM
              (SETQ ORDER (+ ORDER 1))
              (SETQ ORDER1 (STRCAT (ITOA ORDER) "TH"))
              (PROMPT"\nKEYIN LAYER NAME:<")(PROMPT ORDER1)(PROMPT">")
              (SETQ G10LAY (GETSTRING T))
              (IF (= G10LAY "")
                  (WRITE-LINE "" FC)
                  (WRITE-LINE G10LAY FC)
              )
           )
           (CLOSE FC)
         )
       )
        (IF (/= G10NUM NIL)
           (PROGN
              (SETQ FC (OPEN "/ACAD/HON/SET/G10.SET" "r"))
              (SETQ G10NUM (READ-LINE FC))
              (SETQ G10NUM (ATOI G10NUM))
              (SETQ FY1 "")
              (SETQ FY "")
              (SETQ P1 (GETPOINT"\nBASE POINT:"))
              (SETQ P2 (GETPOINT P1"\nTO POINT:"))
              (PROMPT"\nGROUP 10 LAYERS HAVE:")
              (PROMPT "<" )
              (REPEAT G10NUM
                 (SETQ G10LAY (READ-LINE FC))

                 (SETQ MAX (GETVAR "EXTMAX"))
                 (SETQ MIN (GETVAR "EXTMIN"))
                 (COMMAND "SELECT" "CROSSING" MIN MAX "")
                 (SETQ LA G10LAY)
                 (SETQ SA (SSGET "X" (LIST (CONS 8 LA))))
                 (IF (/= SA NIL)
                     (PROGN
                       (COMMAND "COPY" SA "" P1 P2)
                       (SETQ SA NIL)
                     )
                 )

                 (SETQ FY (STRCAT G10LAY "," FY))
                 (SETQ FY1 FY)
                 (PROMPT G10LAY)(PROMPT"  ")
                 (IF (= G10LAY "")
                     (PROGN
                       (COMMAND "G10")
                       (SETQ G10NUM 0)
                     )
                 )
              )
              (PROMPT">")
           (CLOSE FC)
           )
        )
     )
 )
