(DEFUN C:RPCLY()
;SET LAYER
(COMMAND "SETVAR" "CMDECHO" 0)
(SETQ NY (GETVAR "CLAYER"))
;(IF (= (TYPE F1) 'FILE ) "YES"  (STOP))
;(IF (= (TYPE F2) 'FILE ) "YES" (STOP))
(setq RPSET (findfile "C:/ACAD/ACAD/SUPPORT/RP.SET"))
(IF (= RPSET NIL)
    (PROGN
       (PROMPT "\nPLEASE SETTING LAYER RETURN PIN :" )
       (SETQ FC (OPEN "C:/ACAD/ACAD/SUPPORT/RP.SET" "w"))
       (setq RPCNT (GETSTRING T"\nSETTING RETURN PIN  LAYER OF CONTNIUE LINE ? <0>:"))
       (IF (= RPCNT "")
              (WRITE-LINE "0" FC)
              (WRITE-LINE RPCNT FC)
       )
       (setq RPCEN (GETSTRING T"\nSETTING RETURN PIN LAYER OF CENTER LINE ? <CEN>:"))
       (IF (= RPCEN "")
              (WRITE-LINE "CEN" FC)
              (WRITE-LINE RPCEN FC)
       )
       (setq RPHID (GETSTRING T"\nSETTING RETURN PIN LAYER OF HIDDEN LINE ? <HID>:"))
       (IF (= RPHID "")
              (WRITE-LINE "HID" FC)
              (WRITE-LINE RPHID FC)
       )
       (setq RPDIM (GETSTRING T"\nSETTING RETURN PIN LAYER OF DIMESION /<DIM1>:"))
       (IF (= RPDIM "")
              (WRITE-LINE "DIM1" FC)
              (WRITE-LINE RPDIM FC)
       )
       (setq RPTXT (GETSTRING T"\nSETTING RETURN PIN LAYER OF TEXT ? <TEXT>:"))
       (IF (= RPTXT "")
              (WRITE-LINE "TEXT" FC)
              (WRITE-LINE RPTXT FC)
       )
       (CLOSE FC)
    )
)

(IF (/= RPSET NIL)
    (PROGN
       (SETQ FC (OPEN "C:/ACAD/ACAD/SUPPORT/RP.SET" "r"))
       (SETQ RPCNT (READ-LINE FC))
       (SETQ RPCEN (READ-LINE FC))
       (SETQ RPHID (READ-LINE FC))
       (SETQ RPDIM (READ-LINE FC))
       (SETQ RPTXT (READ-LINE FC))
       (IF (OR (= RPCNT "") (= RPCEN "") (= RPHID "") (= RPDIM "") (= RPTXT "")
               (= RPCNT NIL) (= RPCEN NIL) (= RPHID NIL) (= RPDIM NIL) (= RPTXT NIL))
           (CLOSE FC)
       )
       (IF (OR (= RPCNT "") (= RPCEN "") (= RPHID "") (= RPDIM "") (= RPTXT "")
               (= RPCNT NIL) (= RPCEN NIL) (= RPHID NIL) (= RPDIM NIL) (= RPTXT NIL))
           (PROGN
              (PROMPT "\nPLEASE SETTING LAYER RETURN PIN :" )
              (SETQ FC (OPEN "C:/ACAD/ACAD/SUPPORT/RP.SET" "w"))
              (setq RPCNT (GETSTRING T"\nSETTING RETURN PIN  LAYER OF CONTNIUE LINE ? <0>:"))
              (IF (= RPCNT "")
                  (WRITE-LINE "0" FC)
                  (WRITE-LINE RPCNT FC)
              )
              (setq RPCEN (GETSTRING T"\nSETTING RETURN PIN LAYER OF CENTER LINE ? <CEN>:"))
              (IF (= RPCEN "")
                  (WRITE-LINE "CEN" FC)
                  (WRITE-LINE RPCEN FC)
              )
              (setq RPHID (GETSTRING T"\nSETTING RETURN PIN LAYER OF HIDDEN LINE ? <HID>:"))
              (IF (= RPHID "")
                  (WRITE-LINE "HID" FC)
                  (WRITE-LINE RPHID FC)
              )
              (setq RPDIM (GETSTRING T"\nSETTING RETURN PIN LAYER OF DIMESION /<DIM1>:"))
              (IF (= RPDIM "")
                  (WRITE-LINE "DIM1" FC)
                  (WRITE-LINE RPDIM FC)
              )
              (setq RPTXT (GETSTRING T"\nSETTING RETURN PIN LAYER OF TEXT ? <TEXT>:"))
              (IF (= RPTXT "")
                  (WRITE-LINE "TEXT" FC)
                  (WRITE-LINE RPTXT FC)
              )
           (CLOSE FC)
           )
       )
       (SETQ FC (OPEN "C:/ACAD/ACAD/SUPPORT/RP.SET" "r"))
       (SETQ RPCNT (READ-LINE FC))
       (SETQ RPCEN (READ-LINE FC))
       (SETQ RPHID (READ-LINE FC))
       (SETQ RPDIM (READ-LINE FC))
       (SETQ RPTXT (READ-LINE FC))
       (CLOSE FC)
       (PROMPT "\nR.P CONTINUE OF LAYER IS:" )(PROMPT RPCNT)(TERPRI)
       (PROMPT "\nR.P CENTER OF LAYER IS:" ) (PROMPT RPCEN)(TERPRI)
       (PROMPT "\nR.P HIDDEN OF LAYER IS:" ) (PROMPT RPHID)(TERPRI)
       (PROMPT "\nR.P DIMENSION OF LAYER IS:" ) (PROMPT RPDIM)(TERPRI)
       (PROMPT "\nR.P TEXT   OF LAYER IS:" ) (PROMPT RPTXT)(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/RP.SET" "w"))
       (PROMPT "\nR.P CONTINUE OF LAYER " )(PROMPT "<")(PROMPT RPCNT) (PROMPT ">:")
       (setq RPCNT (GETSTRING T))
       (IF (= RPCNT "")
              (WRITE-LINE "0" FC)
              (WRITE-LINE RPCNT FC)
       )
       (PROMPT "\nR.P CENTER OF LAYER " )(PROMPT "<")(PROMPT RPCEN) (PROMPT ">:")
       (setq RPCEN (GETSTRING T))
       (IF (= RPCEN "")
              (WRITE-LINE "CEN" FC)
              (WRITE-LINE RPCEN FC)
       )
       (PROMPT "\nR.P HIDDEN OF LAYER " )(PROMPT "<")(PROMPT RPHID) (PROMPT ">:")
       (setq RPHID (GETSTRING T))
       (IF (= RPHID "")
              (WRITE-LINE "HID" FC)
              (WRITE-LINE RPHID FC)
       )
       (PROMPT "\nR.P DIMESION OF LAYER ")(PROMPT"<")(PROMPT RPDIM)(PROMPT">:")
       (setq RPDIM (GETSTRING T))
       (IF (= RPDIM "")
              (WRITE-LINE "DIM1" FC)
              (WRITE-LINE RPDIM FC)
       )
       (PROMPT "\nR.P TEXT OF LAYER " )(PROMPT "<")(PROMPT RPTXT)(PROMPT ">:")
       (setq RPTXT (GETSTRING T))
       (IF (= RPTXT "")
              (WRITE-LINE "TEXT" FC)
              (WRITE-LINE RPTXT FC)
       )
       (CLOSE FC)
       (SETQ FC (OPEN "C:/ACAD/ACAD/SUPPORT/RP.SET" "r"))
       (SETQ RPCNT (READ-LINE FC))
       (SETQ RPCEN (READ-LINE FC))
       (SETQ RPHID (READ-LINE FC))
       (SETQ RPDIM (READ-LINE FC))
       (SETQ RPTXT (READ-LINE FC))
       (CLOSE FC)
       (PROMPT "\nR.P CONTINUE OF LAYER NOW IS:" )(PROMPT RPCNT)(TERPRI)
       (PROMPT "\nR.P CENTER   OF LAYER NOW IS:" ) (PROMPT RPCEN)(TERPRI)
       (PROMPT "\nR.P HIDDEN   OF LAYER NOW IS:" ) (PROMPT RPHID)(TERPRI)
       (PROMPT "\nR.P DIMENSION OF LAYER IS:" ) (PROMPT RPDIM)(TERPRI)
       (PROMPT "\nR.P TEXT   OF WORD IS:" ) (PROMPT RPTXT)(TERPRI)
  )
)
)
