(defun c:k3()
(SETQ NLY (GETVAR "CLAYER"))
(setq STOP2SET (findfile "c:/acad/hon/set/STOP2.SET"))
(IF (= STOP2SET NIL)
    (PROGN
       (PROMPT "\nPLEASE SETTING LAYER STOP2 :" )
       (SETQ FC (OPEN "c:/acad/hon/set/STOP2.SET" "w"))
       (setq STOP2CNT (GETSTRING T"\nSETTING STOP2 LAYER OF CONTNIUE LINE/<0>:"))
       (IF (= STOP2CNT "")
              (WRITE-LINE "0" FC)
              (WRITE-LINE STOP2CNT FC)
       )
       (setq STOP2CEN (GETSTRING T"\nSETTING STOP2 LAYER OF CENTER LINE/<CEN>:"))
       (IF (= STOP2CEN "")
              (WRITE-LINE "CEN" FC)
              (WRITE-LINE STOP2CEN FC)
       )
       (setq STOP2HID (GETSTRING T"\nSETTING STOP2 LAYER OF HIDDEN LINE/<HID>:"))
       (IF (= STOP2HID "")
            (WRITE-LINE "HID" FC)
         (WRITE-LINE STOP2HID FC)
       )
       (setq STOP2DIM (GETSTRING T"\nSETTING STOP2 LAYER OF DIMESION /<DIM1>:"))
       (IF (= STOP2DIM "")
              (WRITE-LINE "DIM1" FC)
              (WRITE-LINE STOP2DIM FC)
       )
       (setq STOP2TXT (GETSTRING T"\nSETTING STOP2 LAYER OF TEXT /<TEXT>:"))
       (IF (= STOP2TXT "")
              (WRITE-LINE "TEXT" FC)
              (WRITE-LINE STOP2TXT FC)
       )
       (CLOSE FC)
    )
)

(IF (/= STOP2SET NIL)
    (PROGN
       (SETQ FC (OPEN "c:/acad/hon/set/STOP2.SET" "r"))
       (SETQ STOP2CNT (READ-LINE FC))
       (SETQ STOP2CEN (READ-LINE FC))
       (SETQ STOP2HID (READ-LINE FC))
       (SETQ STOP2DIM (READ-LINE FC))
       (SETQ STOP2TXT (READ-LINE FC))
       (IF (OR (= STOP2CNT "") (= STOP2CEN "") (= STOP2HID "") (= STOP2DIM "") (= STOP2TXT "")
               (= STOP2CNT NIL) (= STOP2CEN NIL) (= STOP2HID NIL) (= STOP2DIM NIL) (= STOP2TXT NIL))
           (CLOSE FC)
       )
(IF (OR (= STOP2CNT "") (= STOP2CEN "") (= STOP2HID "") (= STOP2DIM "") (= STOP2TXT "")
               (= STOP2CNT NIL) (= STOP2CEN NIL) (= STOP2HID NIL) (= STOP2DIM NIL) (= STOP2TXT NIL))
           (PROGN
              (PROMPT "\nPLEASE SETTING LAYER OF SCREW :" )
              (SETQ FC (OPEN "c:/acad/hon/set/STOP2.SET" "w"))
              (setq STOP2CNT (GETSTRING T"\nSETTING STOP2 LAYER OF CONTNIUE LINE/<0>:"))
              (IF (= STOP2CNT "")
                  (WRITE-LINE "0" FC)
                  (WRITE-LINE STOP2CNT FC)
              )
              (setq STOP2CEN (GETSTRING T"\nSETTING STOP2 LAYER OF CENTER LINE/<CEN>:"))
              (IF (= STOP2CEN "")
                  (WRITE-LINE "CEN" FC)
                  (WRITE-LINE STOP2CEN FC)
              )
              (setq STOP2HID (GETSTRING T"\nSETTING STOP2 LAYER OF HIDDEN LINE/<HID>:"))
              (IF (= STOP2HID "")
                  (WRITE-LINE "HID" FC)
                  (WRITE-LINE STOP2HID FC)
              )
              (setq STOP2DIM (GETSTRING T"\nSETTING STOP2 LAYER OF DIMESION/<DIM1>:"))
              (IF (= STOP2DIM "")
                  (WRITE-LINE "DIM1" FC)
                  (WRITE-LINE STOP2DIM FC)
              )
              (setq STOP2TXT (GETSTRING T"\nSETTING STOP2 LAYER OF TEXT /<TEXT>:"))
              (IF (= STOP2TXT "")
                  (WRITE-LINE "TEXT" FC)
                  (WRITE-LINE STOP2TXT FC)
              )
           (CLOSE FC)
           )
       )
       (SETQ FC (OPEN "c:/acad/hon/set/STOP2.SET" "r"))
       (SETQ STOP2CNT (READ-LINE FC))
       (SETQ STOP2CEN (READ-LINE FC))
       (SETQ STOP2HID (READ-LINE FC))
       (SETQ STOP2DIM (READ-LINE FC))
       (SETQ STOP2TXT (READ-LINE FC))
       (CLOSE FC)
       (PROMPT "\nSCREW CONTINUE OF LAYER IS:" )(PROMPT STOP2CNT)(TERPRI)
       (PROMPT "\nSCREW CENTER OF LAYER IS:" ) (PROMPT STOP2CEN)(TERPRI)
       (PROMPT "\nSCREW HIDDEN OF LAYER IS:" ) (PROMPT STOP2HID)(TERPRI)
       (PROMPT "\nSCREW DIMENSION OF LAYER IS:" ) (PROMPT STOP2DIM)(TERPRI)
       (PROMPT "\nSCREW TEXT   OF LAYER IS:" ) (PROMPT STOP2TXT)(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/STOP2.SET" "w"))
       (PROMPT "\nSCREW CONTINUE OF LAYER <" )(PROMPT STOP2CNT)(PROMPT">:")
       (setq STOP2CNT (GETSTRING T))
       (IF (= STOP2CNT "")
              (WRITE-LINE "0" FC)
              (WRITE-LINE STOP2CNT FC)
       )
       (PROMPT "\nSCREW CENTER OF LAYER <" )(PROMPT STOP2CEN)(PROMPT">:")
       (setq STOP2CEN (GETSTRING T))
       (IF (= STOP2CEN "")
              (WRITE-LINE "CEN" FC)
              (WRITE-LINE STOP2CEN FC)
       )
       (PROMPT "\nSCREW HIDDEN OF LAYER <" )(PROMPT STOP2HID)(PROMPT">:")
       (setq STOP2HID (GETSTRING T))
       (IF (= STOP2HID "")
              (WRITE-LINE "HID" FC)
              (WRITE-LINE STOP2HID FC)
       )
       (PROMPT "\nSCREW DIMESION OF LAYER <" )(PROMPT STOP2DIM)(PROMPT">:")
       (setq STOP2DIM (GETSTRING T))
       (IF (= STOP2DIM "")
              (WRITE-LINE "DIM1" FC)
              (WRITE-LINE STOP2DIM FC)
       )
       (PROMPT "\nSCREW TEXT OF LAYER <" )(PROMPT STOP2TXT)(PROMPT">:")
       (setq STOP2TXT (GETSTRING T))
       (IF (= STOP2TXT "")
              (WRITE-LINE "TEXT" FC)
              (WRITE-LINE STOP2TXT FC)
       )
       (CLOSE FC)
       (SETQ FC (OPEN "c:/acad/hon/set/STOP2.SET" "r"))
    (SETQ STOP2CNT (READ-LINE FC))
       (SETQ STOP2CEN (READ-LINE FC))
       (SETQ STOP2HID (READ-LINE FC))
       (SETQ STOP2DIM (READ-LINE FC))
       (SETQ STOP2TXT (READ-LINE FC))
       (CLOSE FC)
       (PROMPT "\nSCREW CONTINUE OF LAYER NOW IS:" )(PROMPT STOP2hid)(TERPRI)
       (PROMPT "\nSCREW CENTER   OF LAYER NOW IS:" ) (PROMPT STOP2CEN)(TERPRI)
       (PROMPT "\nSCREW HIDDEN   OF LAYER NOW IS:" ) (PROMPT STOP2HID)(TERPRI)
       (PROMPT "\nSCREW DIM      OF LAYER NOW IS:" ) (PROMPT STOP2DIM)(TERPRI)
       (PROMPT "\nSCREW TEXT     OF LAYER NOW  IS:" ) (PROMPT STOP2TXT)(TERPRI)
  )
)
 (MENUCMD "S=X")
 (MENUCMD "S=K2")
   (COMMAND "VSLIDE" "c:/acad/hon/B/K3")
 (SETQ DIM (GETREAL"\nPLEASE SLECT THE DIM OF THE ENTITY:(DIM10)" ))
 (IF (OR ( = DIM "" ) (= DIM NIL ) )
     (PROGN
     (SETQ DIM 10 )
 ))
 (IF (= DIM 10 )
    (PROGN
       ( SETQ d 6 )
       ( SETQ DD1 16 )
       ( SETQ sld 10  )
       ( SETQ H1 8    )
       ( SETQ g  15  )
       ( SETQ k  16  )
       ( SETQ P  1   )
       ))
 (IF (= DIM 13 )
    (PROGN
       ( SETQ d 8 )
       ( SETQ DD1 18 )
       ( SETQ sld 10  )
       ( SETQ H1 8    )
       ( SETQ g  17   )
       ( SETQ k  18  )
       ( SETQ P  1.25 )
       ))
 (IF (= DIM 16 )
    (PROGN
       ( SETQ d 8 )
       ( SETQ DD1 22 )
       ( SETQ sld 16  )
       ( SETQ H1 8    )
       ( SETQ g  21   )
       ( SETQ k  22  )
       ( SETQ P  1.25 )
       ))
 (IF (= DIM 18 )
    (PROGN
       ( SETQ d 10 )
       ( SETQ DD1 24 )
       ( SETQ sld 18  )
       ( SETQ H1 10   )
       ( SETQ g  23  )
       ( SETQ k  24  )
       ( SETQ P  1.5 )
       ))
 (IF (= DIM 20 )
    (PROGN
       ( SETQ d 12 )
       ( SETQ DD1 27 )
       ( SETQ sld 20  )
       ( SETQ H1 10   )
       ( SETQ g  26  )
       ( SETQ k  27  )
       ( SETQ P  1.75 )
       ))
 (IF (= DIM 25 )
    (PROGN
       ( SETQ d 14 )
       ( SETQ DD1 33 )
       ( SETQ sld 25  )
       ( SETQ H1 12 )
       ( SETQ g  32  )
       ( SETQ k  33  )
       ( SETQ P  1.75 )
       ))
 (IF (= DIM 30 )
    (PROGN
       ( SETQ d 16 )
       ( SETQ DD1 38 )
       ( SETQ sld 30  )
       ( SETQ H1 12   )
       ( SETQ g  37  )
       ( SETQ k  38  )
       ( SETQ P  2   )
       ))
 (IF (= DIM 35 )
    (PROGN
       ( SETQ d 20 )
       ( SETQ DD1 43 )
       ( SETQ sld 35  )
       ( SETQ H1 15   )
       ( SETQ g  42  )
       ( SETQ k  43  )
       ( SETQ P 2.5  )
       ))
   (COMMAND "REDRAW")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  (SETQ p1 (GETPOINT"\n SELECT P1  BASE POINT:"))
  (SETQ P2 (GETPOINT p1"\n SELECT P2 BASE POINT:"))
  (SETQ P3 (GETPOINT P2"\n SELECT P3 BASE POINT:"))
  (SETQ pp4 (GETPOINT P3"\n SELECT P4 BASE POINT:"))
  (SETQ AG1 (ANGLE p1 P2 ) )
  (SETQ AG2 (* PI 0.5 ))
  (SETQ PLE (DISTANCE p1 P2  ))
  (SETQ PLE1 (DISTANCE p2 P3  ))
  (SETQ PLE2 (DISTANCE p3 pp4  ))
  (SETQ h2 (- (- (- (- PLE SLD ) H1 ) D ) 2 ))
  (SETQ ss (GETREAL  "\n PLEASE ENTER THE ss(WIDETH) VALUE:"))
  (SETQ p4  (POLAR p1 AG1  2.0   ))
  (SETQ s   (* 2.5 sld ) )
  (SETQ s1  (- (- (- ple2 s  ) h1 ) ss )   )
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  (SETQ ld (- (- (- ple h1 ) h2 ) 2 )  )
  (SETQ DR1 (POLAR P4 (- AG1 AG2 )  (/ g 2.0 ) ) )
  (SETQ p5  (POLAR p4  AG1   1 ))
  (SETQ DR2 (POLAR p5  (- AG1 AG2 ) (/ k 2.0 )))
  (SETQ p6  (POLAR p4  AG1  H1 ) )
  (SETQ DR3 (POLAR  p6 (- AG1 ag2 ) (/ k 2.0 )))
  (SETQ DR9 (POLAR  p6 (- AG1 ag2 ) (/ SLD 2.0 ) ))
  (SETQ DR4 (POLAR dr9 AG1   h2 ))
  (SETQ DR6 (POLAR dr4 AG1   LD ))
  (SETQ DR5 (POLAR dr4 ( - AG1 AG2 ) 0.5  ))
  (SETQ DR7 (POLAR p2  ( - AG1 AG2 ) (+ (/ sld 2.0 ) 0.5 )   ))
  (SETQ DR8 (POLAR  p2  (- AG1 AG2 ) (/ D 2.0 ) ))
  (SETQ DR10  (POLAR DR8 (- AG1 ag2 )  0.5 ))
  (SETQ CR5 (POLAR dr8 AG1 PLE1 ))
  (SETQ CR6 (POLAR dr10 AG1 PLE1 ))
  (SETQ DR11 (POLAR P4 (+ AG1 AG2 )  (/ g 2.0 ) ) )
  (SETQ DR22 (POLAR p5  (+ AG1 AG2 ) (/ k 2.0 )))
  (SETQ DR33 (POLAR  p6 (+ AG1 ag2 ) (/ k 2.0 )))
  (SETQ DR99 (POLAR  p6 (+ AG1 ag2 ) (/ SLD 2.0 ) ))
  (SETQ DR44 (POLAR dr99 AG1   h2 ))
  (SETQ DR66 (POLAR dr44 AG1   LD ))
  (SETQ DR55 (POLAR dr44 ( + AG1 AG2 ) 0.5  ))
  (SETQ DR77 (POLAR p2   ( + AG1 AG2 ) ( + (/ sld 2 ) 0.5 ) ))
  (SETQ DR88 (POLAR  p2  (+ AG1 AG2 ) (/ D 2.0 ) ))
  (SETQ DR100  (POLAR DR88 (+ AG1 ag2 )  0.5 ))
  (SETQ CR55 (POLAR dr88  AG1 PLE1 ))
  (SETQ CR66 (POLAR dr100 AG1 PLE1 ))
  (SETQ bR1 (POLAR cr5 (+ AG1 ag2 ) p  ))
  (SETQ bR11 (POLAR cr55 (- AG1 ag2 ) p  ))
  (SETQ bR3 (POLAR br1    AG1 ( * 1.5  d )))
  (SETQ bR33 (POLAR br11   AG1 (* 1.5 d ) ))
  (SETQ bR2 (POLAR cr5    AG1 (- ( * 1.5 d )  1 )))
  (SETQ bR22 (POLAR cr55   AG1 (- (* 1.5 d )  1 )))
  (SETQ bR4  (POLAR br1  (+ AG1 pi ) (- s (* 1.5 d )  )))
  (SETQ bR44 (POLAR br11 (+ AG1 pi ) (- s (* 1.5 d )  )))
  (SETQ bR5  (POLAR br4  (- AG1 ag2 )   p ))
  (SETQ bR55 (POLAR br44 (+ AG1 ag2 ) p   ))
   (COMMAND "LAYER" "S" STOP2HID"")
 (command "LINE" p4 dr1 dr2 dr3 DR9 dr4 dr6 dr10 CR6 "")
 (command "LINE" p4 dr11 dr22 dr33 dr99 dr44 dr66 dr100 CR66 "")
 (command "LINE" dr8 dr88 "")
 (command "LIne" dr9 dr99 "")
 (command "LINE" dr2 dr22 "")
 (command "LINE" dr8 Cr5  "")
 (command "LINE" dr88 CR55 "")
 (command "LINE" dr5 dr7  "")
 (command "LINE" dr55 dr77 "")
  (command "LINE" cr5  br2 br3 br33 br22 cr55  "")
  (command "LINE" br2  br22  "")
  (command "LINE" br1  br4   "")
  (command "LINE" br11 br44 br4 "")
  (command "LINE" br5  br55  "")
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  (SETQ p8  (POLAR p3  AG1 s  ))
  (SETQ p9  (POLAR p8 AG1 ss ))
  (SETQ kR1 (POLAR p3  (- AG1 AG2 ) (+ ( / sld 2.0 ) 0.5 ) ))
  (SETQ kr2 (POLAR p3  (- AG1 AG2 ) (/ sld 2.0 ) ))
  (SETQ kr3 (POLAR kr1 AG1 s  ))
  (SETQ kr4 (POLAR kr2    AG1 s    ))
  (SETQ kr5 (POLAR kr4    AG1 sS ))
  (SETQ kr6 (POLAR p9 (- AG1 ag2 ) (/ dd1 2.0 ) ))
  (SETQ kr7 (POLAR kr6    AG1 h1 ))
  (SETQ kR11 (POLAR p3  (+ AG1 AG2 ) (+ ( / sld 2.0 ) 0.5 ) ))
  (SETQ kr22 (POLAR p3  (+ AG1 AG2 ) (/ sld 2.0 ) ))
  (SETQ kr33 (POLAR kr11 AG1 s  ))
  (SETQ kr44 (POLAR kr22    AG1 s    ))
  (SETQ kr55 (POLAR kr44    AG1 sS ))
  (SETQ kr66 (POLAR p9 (+ AG1 ag2 ) (/ dd1 2.0 ) ))
  (SETQ kr77 (POLAR kr66   AG1 h1 ))
  (SETQ CR7  (POLAR br1  AG1 (* D 2   ) ))
  (SETQ CR77 (POLAR br11 AG1 (* D 2    ) ))
  (SETQ CR8  (POLAR CR7  AG1 (* P 2 ) ))
  (SETQ CR88  (POLAR CR77 AG1 (* P 2 ) ))
  (SETQ CR9   (POLAR CR8  (+ AG1 (/ PI 3 ))     1        ))
  (SETQ CR99  (POLAR CR88 (- AG1 (/ PI 3 ))     1        ))
  (SETQ G9    (INTERS CR8 CR9 CR88 CR99 NIL ))
  (SETQ M9   (POLAR  P6  AG1  H2 ))
  (SETQ QR2   (POLAR M9  (- AG1 ag2 ) (+ (/ DD1 2.0) 1 )))
  (SETQ QR4   (POLAR M9  (- AG1 ag2 ) (+ (/ SLD 2.0) 0.5 )))
  (SETQ QR1   (POLAR qr2 (+ AG1 PI  ) (+ (+ H1 H2  ) 2 ) ))
  (SETQ QR22  (POLAR M9  (+ AG1 ag2 ) (+ (/ DD1 2.0) 1 )))
  (SETQ QR11  (POLAR qr22 (+ AG1 PI  )    (+ (+ H1 H2  ) 2 )    ))
  (SETQ QR44  (POLAR M9  (+ AG1 ag2 ) (+ (/ SLD 2.0) 0.5 )))
  (SETQ GR1   (POLAR P8  (- AG1 ag2 ) (+ (/ DD1 2.0) 1 )))
  (SETQ GR2   (POLAR PP4 (- AG1 ag2 ) (+ (/ DD1 2.0) 1 )))
  (SETQ GR11  (POLAR P8  (+ AG1 ag2 ) (+ (/ DD1 2.0) 1 )))
  (SETQ GR22  (POLAR PP4 (+ AG1 ag2 ) (+ (/ DD1 2.0) 1 )))
   (COMMAND "LAYER" "S" STOP2HID"")
 (command "LINE" br1 cr7    "")
 (command "LINE" br11 cr77  "")
 (command "LINE" KR1 KR3  "")
 (command "LINE" KR11  KR33 "")
 (command "LINE" KR2 KR4 kr5 kr6 kr7 kr77 kr66 kr55 kr22  "")
 (command "LINE" KR5 KR55 "")
 (command "LINE" CR5 br2 br3 CR7  CR8  "")
 (command "LINE" br33 cr77 cr88 "")
 (command "LINE" G9 CR8  "")
 (command "LINE" G9 CR88 "")
 (command "LINE" cr7 cr77 "")
 (command "LINE" cr8 cr88 "")
 (command "LINE" QR1 QR2 QR4 dr7 "")
 (command "LINE" QR11 QR22 QR44 dr77  "")
 (command "LINE" KR3 GR1 GR2  "")
 (command "LINE" KR33 GR11 GR22  "")
  (COMMAND "LAYER" "S" STOP2CEN"")
  (SETQ CEN1  (POLAR P1   (+ AG1 PI ) 1   ))
  (SETQ CEN2  (POLAR PP4  AG1 10 ))
  (command "LINE" CEN1 CEN2 "")
  (COMMAND "LAYER" "S" NLY "")
    )
