(DEFUN C:GPCLY()
;SET LAYER
(COMMAND "SETVAR" "CMDECHO" 0)
(SETQ NY (GETVAR "CLAYER"))
;(IF (= (TYPE F1) 'FILE ) "YES"  (STOP))
;(IF (= (TYPE F2) 'FILE ) "YES" (STOP))
(setq GPSET (findfile "c:/acad/ACAD/SUPPORT/GP.SET"))
(IF (= GPSET NIL)
    (PROGN
       (PROMPT "\nPLEASE SETTING LAYER GIUDE PIN :" )
       (SETQ FC (OPEN "c:/acad/ACAD/SUPPORT/GP.SET" "w"))
       (setq GPCNT (GETSTRING T"\nSETTING GUIDE PIN  LAYER OF CONTNIUE LINE ? <0>:"))
       (IF (= GPCNT "")
              (WRITE-LINE "0" FC)
              (WRITE-LINE GPCNT FC)
       )
       (setq GPCEN (GETSTRING T"\nSETTING GUIDE PIN LAYER OF CENTER LINE ? <CEN>:"))
       (IF (= GPCEN "")
              (WRITE-LINE "CEN" FC)
              (WRITE-LINE GPCEN FC)
       )
       (setq GPHID (GETSTRING T"\nSETTING GUIDE PIN LAYER OF HIDDEN LINE ? <HID>:"))
       (IF (= GPHID "")
              (WRITE-LINE "HID" FC)
              (WRITE-LINE GPHID FC)
       )
       (setq GPDIM (GETSTRING T"\nSETTING GUIDE PIN WORD IS LP OR GP ? <GP>:"))
       (IF (= GPDIM "")
              (WRITE-LINE "GP" FC)
              (WRITE-LINE GPDIM FC)
       )
       (setq GPTXT (GETSTRING T"\nSETTING GUIDE PIN LAYER OF TEXT ? <TEXT>:"))
       (IF (= GPTXT "")
              (WRITE-LINE "TEXT" FC)
              (WRITE-LINE GPTXT FC)
       )
       (CLOSE FC)
    )
)

(IF (/= GPSET NIL)
    (PROGN
       (SETQ FC (OPEN "c:/acad/ACAD/SUPPORT/GP.SET" "r"))
       (SETQ GPCNT (READ-LINE FC))
       (SETQ GPCEN (READ-LINE FC))
       (SETQ GPHID (READ-LINE FC))
       (SETQ GPDIM (READ-LINE FC))
       (SETQ GPTXT (READ-LINE FC))
       (IF (OR (= GPCNT "") (= GPCEN "") (= GPHID "") (= GPDIM "") (= GPTXT "")
               (= GPCNT NIL) (= GPCEN NIL) (= GPHID NIL) (= GPDIM NIL) (= GPTXT NIL))
           (CLOSE FC)
       )
       (IF (OR (= GPCNT "") (= GPCEN "") (= GPHID "") (= GPDIM "") (= GPTXT "")
               (= GPCNT NIL) (= GPCEN NIL) (= GPHID NIL) (= GPDIM NIL) (= GPTXT NIL))
           (PROGN
              (PROMPT "\nPLEASE SETTING LAYER GIUDE PIN :" )
              (SETQ FC (OPEN "c:/acad/ACAD/SUPPORT/GP.SET" "w"))
              (setq GPCNT (GETSTRING T"\nSETTING GUIDE PIN  LAYER OF CONTNIUE LINE ? <0>:"))
              (IF (= GPCNT "")
                  (WRITE-LINE "0" FC)
                  (WRITE-LINE GPCNT FC)
              )
              (setq GPCEN (GETSTRING T"\nSETTING GUIDE PIN LAYER OF CENTER LINE ? <CEN>:"))
              (IF (= GPCEN "")
                  (WRITE-LINE "CEN" FC)
                  (WRITE-LINE GPCEN FC)
              )
              (setq GPHID (GETSTRING T"\nSETTING GUIDE PIN LAYER OF HIDDEN LINE ? <HID>:"))
              (IF (= GPHID "")
                  (WRITE-LINE "HID" FC)
                  (WRITE-LINE GPHID FC)
              )
              (setq GPDIM (GETSTRING T"\nSETTING GUIDE PIN WORD IS LP OR GP ? <GP>:"))
              (IF (= GPDIM "")
                  (WRITE-LINE "GP" FC)
                  (WRITE-LINE GPDIM FC)
              )
              (setq GPTXT (GETSTRING T"\nSETTING GUIDE PIN LAYER OF TEXT ? <TEXT>:"))
              (IF (= GPTXT "")
                  (WRITE-LINE "TEXT" FC)
                  (WRITE-LINE GPTXT FC)
              )
           (CLOSE FC)
           )
       )
       (SETQ FC (OPEN "c:/acad/ACAD/SUPPORT/GP.SET" "r"))
       (SETQ GPCNT (READ-LINE FC))
       (SETQ GPCEN (READ-LINE FC))
       (SETQ GPHID (READ-LINE FC))
       (SETQ GPDIM (READ-LINE FC))
       (SETQ GPTXT (READ-LINE FC))
       (CLOSE FC)
       (PROMPT "\nG.P CONTINUE OF LAYER IS:" )(PROMPT GPCNT)(TERPRI)
       (PROMPT "\nG.P CENTER OF LAYER IS:" ) (PROMPT GPCEN)(TERPRI)
       (PROMPT "\nG.P HIDDEN OF LAYER IS:" ) (PROMPT GPHID)(TERPRI)
       (PROMPT "\nG.P DIMENSION OF LAYER IS:" ) (PROMPT GPDIM)(TERPRI)
       (PROMPT "\nG.P TEXT   OF LAYER IS:" ) (PROMPT GPTXT)(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 "c:/acad/ACAD/SUPPORT/GP.SET" "w"))
       (PROMPT "\nG.P CONTINUE OF LAYER " )(PROMPT "<")(PROMPT GPCNT) (PROMPT ">:")
       (setq GPCNT (GETSTRING T))
       (IF (= GPCNT "")
              (WRITE-LINE "0" FC)
              (WRITE-LINE GPCNT FC)
       )
       (PROMPT "\nG.P CENTER OF LAYER " )(PROMPT "<")(PROMPT GPCEN) (PROMPT ">:")
       (setq GPCEN (GETSTRING T))
       (IF (= GPCEN "")
              (WRITE-LINE "CEN" FC)
              (WRITE-LINE GPCEN FC)
       )
       (PROMPT "\nG.P HIDDEN OF LAYER " )(PROMPT "<")(PROMPT GPHID) (PROMPT ">:")
       (setq GPHID (GETSTRING T))
       (IF (= GPHID "")
              (WRITE-LINE "HID" FC)
              (WRITE-LINE GPHID FC)
       )
       (PROMPT "\nG.P THE WORDS " )(PROMPT "<")(PROMPT GPDIM) (PROMPT ">:")
       (setq GPDIM (GETSTRING T))
       (IF (= GPDIM "")
              (WRITE-LINE "GP" FC)
              (WRITE-LINE GPDIM FC)
       )
       (PROMPT "\nG.P TEXT OF LAYER " )(PROMPT "<")(PROMPT GPTXT)(PROMPT ">:")
       (setq GPTXT (GETSTRING T))
       (IF (= GPTXT "")
              (WRITE-LINE "TEXT" FC)
              (WRITE-LINE GPTXT FC)
       )
       (CLOSE FC)
       (SETQ FC (OPEN "c:/acad/ACAD/SUPPORT/GP.SET" "r"))
       (SETQ GPCNT (READ-LINE FC))
       (SETQ GPCEN (READ-LINE FC))
       (SETQ GPHID (READ-LINE FC))
       (SETQ GPDIM (READ-LINE FC))
       (SETQ GPTXT (READ-LINE FC))
       (CLOSE FC)
       (PROMPT "\nG.P CONTINUE OF LAYER NOW IS:" )(PROMPT GPCNT)(TERPRI)
       (PROMPT "\nG.P CENTER   OF LAYER NOW IS:" ) (PROMPT GPCEN)(TERPRI)
       (PROMPT "\nG.P HIDDEN   OF LAYER NOW IS:" ) (PROMPT GPHID)(TERPRI)
       (PROMPT "\nG.P DIMENSION OF LAYER IS:" ) (PROMPT GPDIM)(TERPRI)
       (PROMPT "\nG.P TEXT   OF WORD IS:" ) (PROMPT GPTXT)(TERPRI)
  )
)
)
