(defun c:PRESS1()
; (IF (= (TYPE F1) 'FILE ) "YES"  (STOP))
; (IF (= (TYPE F2) 'FILE ) "YES" (STOP))
 (COMMAND "SETVAR" "CMDECHO" 0)
 (SETQ NY (GETVAR "CLAYER"))
 (setq BLSET (findfile "C:/ACAD/HON/SET/PRESS1.SET"))
 (IF (= BLSET NIL)
     (PROGN
        (SETQ TEST 1)
        (PROMPT "\nPLEASE SETTING LAYER:" )
        (SETQ FC (OPEN "C:/ACAD/HON/SET/PRESS1.SET" "w"))
        (setq BLCNT (GETSTRING T"\nSETTING LAYER OF CONTNIUE LINE/<0>:"))
        (IF (= BLCNT "")
               (WRITE-LINE "0" FC)
               (WRITE-LINE BLCNT FC)
        )
        (setq BLCEN (GETSTRING T"\nSETTING LAYER OF CENTER LINE/<CEN>:"))
        (IF (= BLCEN "")
               (WRITE-LINE "CEN" FC)
               (WRITE-LINE BLCEN FC)
        )
        (setq BLHID (GETSTRING T"\nSETTING LAYER OF HIDDEN LINE/<HID>:"))
        (IF (= BLHID "")
               (WRITE-LINE "HID" FC)
               (WRITE-LINE BLHID FC)
        )
        (setq BLDIM (GETSTRING T"\nSETTING LAYER OF DIMESION /<DIM1>:"))
        (IF (= BLDIM "")
               (WRITE-LINE "DIM1" FC)
               (WRITE-LINE BLDIM FC)
        )
        (setq BLTXT (GETSTRING T"\nSETTING LAYER OF TEXT /<TEXT>:"))
        (IF (= BLTXT "")
               (WRITE-LINE "TEXT" FC)
               (WRITE-LINE BLTXT FC)
        )
        (CLOSE FC)
     )
 )

 (IF (/= BLSET NIL)
     (PROGN
        (SETQ FC (OPEN "C:/ACAD/HON/SET/PRESS1.SET" "r"))
        (SETQ BLCNT (READ-LINE FC))
        (SETQ BLCEN (READ-LINE FC))
        (SETQ BLHID (READ-LINE FC))
        (SETQ BLDIM (READ-LINE FC))
        (SETQ BLTXT (READ-LINE FC))
        (IF (OR (= BLCNT "") (= BLCEN "") (= BLHID "") (= BLDIM "") (= BLTXT "")
                (= BLCNT NIL) (= BLCEN NIL) (= BLHID NIL) (= BLDIM NIL) (= BLTXT NIL))
            (CLOSE FC)
        )
        (IF (OR (= BLCNT "") (= BLCEN "") (= BLHID "") (= BLDIM "") (= BLTXT "")
                (= BLCNT NIL) (= BLCEN NIL) (= BLHID NIL) (= BLDIM NIL) (= BLTXT NIL))
            (PROGN
               (PROMPT "\nPLEASE SETTING LAYER:" )
               (SETQ FC (OPEN "C:/ACAD/HON/SET/PRESS1.SET" "w"))
               (setq BLCNT (GETSTRING T"\nSETTING LAYER OF CONTNIUE LINE/<0>:"))
               (IF (= BLCNT "")
                   (WRITE-LINE "0" FC)
                   (WRITE-LINE BLCNT FC)
               )
               (setq BLCEN (GETSTRING T"\nSETTING LAYER OF CENTER LINE/<CEN>:"))
               (IF (= BLCEN "")
                   (WRITE-LINE "CEN" FC)
                   (WRITE-LINE BLCEN FC)
               )
               (setq BLHID (GETSTRING T"\nSETTING LAYER OF HIDDEN LINE/<HID>:"))
               (IF (= BLHID "")
                   (WRITE-LINE "HID" FC)
                   (WRITE-LINE BLHID FC)
               )
               (setq BLDIM (GETSTRING T"\nSETTING LAYER OF DIMESION/<DIM1>:"))
               (IF (= BLDIM "")
                   (WRITE-LINE "DIM1" FC)
                   (WRITE-LINE BLDIM FC)
               )
               (setq BLTXT (GETSTRING T"\nSETTING LAYER OF TEXT /<TEXT>:"))
               (IF (= BLTXT "")
                   (WRITE-LINE "TEXT" FC)
                   (WRITE-LINE BLTXT FC)
               )
            (CLOSE FC)
            )
        )
        (SETQ FC (OPEN "C:/ACAD/HON/SET/PRESS1.SET" "r"))
        (SETQ BLCNT (READ-LINE FC))
        (SETQ BLCEN (READ-LINE FC))
        (SETQ BLHID (READ-LINE FC))
        (SETQ BLDIM (READ-LINE FC))
        (SETQ BLTXT (READ-LINE FC))
        (CLOSE FC)
        (PROMPT "\nCONTINUE OF LAYER IS:" )(PROMPT BLCNT)(TERPRI)
        (PROMPT "\nCENTER OF LAYER IS:" ) (PROMPT BLCEN)(TERPRI)
        (PROMPT "\nHIDDEN OF LAYER IS:" ) (PROMPT BLHID)(TERPRI)
        (PROMPT "\nDIMENSION OF LAYER IS:" ) (PROMPT BLDIM)(TERPRI)
        (PROMPT "\nTEXT   OF LAYER IS:" ) (PROMPT BLTXT)(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/HON/SET/PRESS1.SET" "w"))
        (PROMPT "\nCONTINUE OF LAYER <" )(PROMPT BLCNT)(PROMPT">:")
        (setq BLCNT (GETSTRING T))
        (IF (= BLCNT "")
               (WRITE-LINE "0" FC)
               (WRITE-LINE BLCNT FC)
        )
        (PROMPT "\nCENTER OF LAYER <" )(PROMPT BLCEN)(PROMPT">:")
        (setq BLCEN (GETSTRING T))
        (IF (= BLCEN "")
               (WRITE-LINE "CEN" FC)
               (WRITE-LINE BLCEN FC)
        )
        (PROMPT "\nHIDDEN OF LAYER <" )(PROMPT BLHID)(PROMPT">:")
        (setq BLHID (GETSTRING T))
        (IF (= BLHID "")
               (WRITE-LINE "HID" FC)
               (WRITE-LINE BLHID FC)
        )
        (PROMPT "\nDIMESION OF LAYER <" )(PROMPT BLDIM)(PROMPT">:")
        (setq BLDIM (GETSTRING T))
        (IF (= BLDIM "")
               (WRITE-LINE "DIM1" FC)
               (WRITE-LINE BLDIM FC)
        )
        (PROMPT "\nTEXT OF LAYER <" )(PROMPT BLTXT)(PROMPT">:")
        (setq BLTXT (GETSTRING T))
        (IF (= BLTXT "")
               (WRITE-LINE "TEXT" FC)
               (WRITE-LINE BLTXT FC)
        )
        (CLOSE FC)
        (SETQ FC (OPEN "C:/ACAD/HON/SET/PRESS1.SET" "r"))
        (SETQ BLCNT (READ-LINE FC))
        (SETQ BLCEN (READ-LINE FC))
        (SETQ BLHID (READ-LINE FC))
        (SETQ BLDIM (READ-LINE FC))
        (SETQ BLTXT (READ-LINE FC))
        (CLOSE FC)
        (PROMPT "\nCONTINUE OF LAYER NOW IS:" )(PROMPT BLCNT)(TERPRI)
        (PROMPT "\nCENTER   OF LAYER NOW IS:" ) (PROMPT BLCEN)(TERPRI)
        (PROMPT "\nHIDDEN   OF LAYER NOW IS:" ) (PROMPT BLHID)(TERPRI)
        (PROMPT "\nDIM      OF LAYER NOW IS:" ) (PROMPT BLDIM)(TERPRI)
        (PROMPT "\nTEXT     OF LAYER NOW  IS:" ) (PROMPT BLTXT)(TERPRI)
   )
 )


  ;THE POINT IS FIST COUNTER Y THEN X
  (MENUCMD "S=X")
  (MENUCMD "S=SPR")
  (SETQ D (GETSTRING"\nSelect dim:"))
  (GRAPHSCR) (TERPRI)                                     ;GRAPHICS MODE
  (IF  (= (SETQ ANS1 (GETSTRING "\nDOU YOU WANT TO CUT PART LINE (P2) :<Y>")) "")
       (SETQ ANS1 "Y"))
  (SETQ ANS1 (STRCASE ANS1))
  (IF (= D "1/2")
      (PROGN
         (SETQ A 8.5)
         (SETQ B 16)
         (SETQ C 17)
         (SETQ E 32)
         (SETQ H  9)
         (SETQ I  6.57)
      )
  )
  (IF (= D "5/8")
      (PROGN
         (SETQ A 10.5)
         (SETQ B 19)
         (SETQ C 21)
         (SETQ E 38)
         (SETQ H  9)
      )
  )
  (IF (= D "3/4")
      (PROGN
         (SETQ A 12)
         (SETQ B 22)
         (SETQ C 24)
         (SETQ E 44)
         (SETQ H 12)
      )
  )
; (SETQ P1 (LIST 563.587 428.28))
; (SETQ P2 (LIST 563.587 528.28))
   (SETQ P1 (GETPOINT "\nP1:"))
   (SETQ P2 (GETPOINT P1 "\nP2:"))
  (SETQ LSE (DISTANCE P1 P2))
  (SETQ AG1 (ANGLE P1 P2))
  (SETQ AG2 (* PI 0.5))
  (SETQ LSE (DISTANCE P1 P2)) ;DIST FOR P1 P2
  (SETQ DR1 (POLAR P1 (+ AG1 AG2) (/ C 2.0)))
  (SETQ DR2 (POLAR P1 (- AG1 AG2) (/ C 2.0)))
  (SETQ DR3 (POLAR (POLAR P1 AG1 LSE) (+ AG1 AG2) (/ C 2.0)))
  (SETQ DR4 (POLAR (POLAR P1 AG1 LSE) (- AG1 AG2) (/ C 2.0)))
  (SETQ DR5 (POLAR P1 (+ AG1 AG2) (/ E 2.0)))
  (SETQ DR6 (POLAR P1 (- AG1 AG2) (/ E 2.0)))
  (SETQ DR7 (POLAR (POLAR P1 AG1 LSE) (+ AG1 AG2) (/ E 2.0)))
  (SETQ DR8 (POLAR (POLAR P1 AG1 LSE) (- AG1 AG2) (/ E 2.0)))
  (SETQ DR9 (POLAR (POLAR P1 AG1 (+ (- LSE 1.41) B)) (+ AG1 AG2) 6.57))
  (SETQ DR10 (POLAR (POLAR P1 AG1 (+ (- LSE 1.41) B)) (- AG1 AG2) 6.57))
  (SETQ DR11 (POLAR (POLAR P1 AG1 (- 0 (- B 1.41))) (+ AG1 AG2) 6.57))
  (SETQ DR12 (POLAR (POLAR P1 AG1 (- 0 (- B 1.41))) (- AG1 AG2) 6.57))
; (IF (= ANS1 "Y")
;     (COMMAND "LAYER" "SET" BLCNT "")
;     (COMMAND "LAYER" "SET" BLHID "")
; )
  (COMMAND "LINE" DR1 DR3 "")
  (COMMAND "LINE" DR2 DR4 "")
  (COMMAND "LINE" DR5 DR7 "")
  (COMMAND "LINE" DR6 DR8 "")
  (COMMAND "ARC" DR4 "E" DR3 "R" A)
  (COMMAND "ARC" DR1 "E" DR2 "R" A)
  (COMMAND "ARC" DR5 "E" DR6 "R" B)
  (COMMAND "ARC" DR8 "E" DR7 "R" B)
  (COMMAND "LINE" DR9 DR10 "")
  (COMMAND "LINE" DR11 DR12 "")
  (COMMAND "LAYER" "SET" BLCEN "")
  (COMMAND "LINE" (POLAR P1 AG1 (- 0 1 B)) (POLAR P1 AG1 (+ 1 LSE B)) "")
  ;(COMMAND "TEXT" TT2 TTH (RTD AG1) DIST1)
  (COMMAND "LAYER" "SET" NY "")
)
