(defun c:D11()
(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 STOP2CNT)(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=D11")
   (COMMAND "VSLIDE" "c:/acad/HON/B/D11")
(SETQ DIM (GETREAL"\nPLEASE SLECT THE DIM OF THE ENTITY:(DIM1~DIM6)::"))
   (COMMAND "REDRAW")
   (IF (OR ( = DIM "") (= DIM NIL) )
   (PROGN
     (SETQ DIM 1 )
     ))
     (IF (= DIM 1 )
    (PROGN
      ( SETQ P 0.65 )
      ( SETQ K 5.6  )
      (COMMAND "LAYER" "S" STOP2CNT  "")
   ))
       (IF (= DIM 2 )
      (PROGN
        ( SETQ P 2.65 )
        ( SETQ K 7.6  )
        (COMMAND "LAYER" "S" STOP2CNT  "")
    ))
        (IF (= DIM 3 )
       (PROGN
         ( SETQ P 5.15 )
         ( SETQ K 10.1 )
        (COMMAND "LAYER" "S" STOP2CNT  "")
    ))

     (IF (= DIM 4 )
    (PROGN
      ( SETQ P 0.65 )
      ( SETQ K 5.6  )
      (COMMAND "LAYER" "S" STOP2HID  "")
    ))
       (IF (= DIM 5 )
      (PROGN
        ( SETQ P 2.65 )
        ( SETQ K 7.6  )
      (COMMAND "LAYER" "S" STOP2HID  "")
    ))
        (IF (= DIM 6 )
       (PROGN
         ( SETQ P 5.15 )
         ( SETQ K 10.1 )
      (COMMAND "LAYER" "S" STOP2HID  "")
   ))
  (SETQ P1 (GETPOINT"\n SLECT THE FIRST BASE POINT:"))
  (SETQ P2 (GETPOINT P1"\n SELECT THE SECOND BASE POINT:"))
  (SETQ AG1 (ANGLE P1 P2 ) )
  (SETQ AG2 (* PI 0.5))
 (SETQ YY (DISTANCE P1 P2 ))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CNT LAYER
  (SETQ DR1   (POLAR P1 ( -  AG1 AG2 )  (/  13.7      2.0 )))
  (SETQ DR2  (POLAR DR1 (+ AG1   ( DTR   45.0 )   ) (* 0.45 (/ 1 ( SIN ( DTR 45 ))  ))   ))
  (SETQ DR3  (POLAR DR1 (+ AG1   ( DTR   45.0 ) ) (* 3.85 (/ 1 ( SIN ( DTR 45 ))  ))  ))
  (SETQ DR11  (POLAR P1 ( +  AG1 AG2 )  (/  13.7      2.0 )))
  (SETQ DR22 (POLAR DR11 (+  AG1  ( DTR 315.)   ) (* 0.45 (/ 1 ( SIN ( DTR 45 ))  ))   ))
  (SETQ DR33 (POLAR DR11 (+       AG1  ( DTR 315.)  ) (* 3.85 (/ 1  ( SIN ( DTR 45 ))  ))   ))
  (SETQ m    (POLAR DR3   (+ AG1 ag2 )      0.6   ))
  (SETQ m1   (POLAR DR33  (- AG1 ag2 )      0.6   ))
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  (SETQ DR4  (POLAR DR3    AG1    (- YY 3.85 )))
  (SETQ DR5  (POLAR M      AG1  (+ 0.6 (- YY 3.85 )  ) ))
  (SETQ DR6  (POLAR DR3    AG1  (+ 2.6 (- YY 3.85 )    ) ))
  (SETQ DR7  (POLAR M        AG1  (+ (- YY 3.85 ) 3.2  )))
  (SETQ DR8  (POLAR M      AG1  (+ (- YY 3.85 ) 5.6  )) )
  (SETQ DR44 (POLAR DR33   AG1     (-  YY 3.85 )   ))
  (SETQ DR55 (POLAR M1     AG1  (+ 0.6 (- YY 3.85 )  ) ))
  (SETQ DR66 (POLAR DR33   AG1  (+ 2.6  (- YY 3.85 )   ) ))
  (SETQ DR77 (POLAR M1       AG1  (+ (- YY 3.85 ) 3.2  )))
  (SETQ DR88 (POLAR M1     AG1  (+ (-  YY 3.85 ) 5.6  )))
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  (SETQ CR1  (POLAR M      AG1       1.15 ))
  (SETQ CR11 (POLAR M1     AG1       1.15 ))
  (SETQ CR2  (POLAR CR1  (- AG1 AG2 )      0.85  ))
  (SETQ CR3  (POLAR CR1  (- AG1 AG2 )  K    ))
  (SETQ CR22 (POLAR CR11 (+ AG1 AG2 ) 0.85  ))
  (SETQ CR33 (POLAR CR11 (+ AG1 AG2 ) K          ))
  (SETQ CR4  (POLAR CR3  (+ AG1 PI  ) 4.5        ))
  (SETQ CR44  (POLAR CR33  (+ AG1 PI  ) 4.5        ))
  (SETQ CR5 (POLAR DR1 (- AG1 AG2 ) P          ))
  (SETQ CR55 (POLAR DR11 (+ AG1 AG2 ) P          ))
  (SETQ GR2  (POLAR CR2  (- AG1 PI  ) 1.4        ))
  (SETQ GR22 (POLAR CR22 (- AG1 PI  ) 1.4        ))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  (SETQ PP1  (POLAR DR8  (+ AG1 ( DTR 60 ) )     2.77      ) )
  (SETQ PP11 (POLAR PP1     AG1                  1         ) )
  (SETQ PP22 (POLAR P1   (+ AG1  PI        )     1         ) )
  (COMMAND "LINE" P1 DR1 dr2 DR3 DR33  DR22 DR11 P1      "")
  (COMMAND "LINE" dr2 dr22     "")
  (COMMAND "LINE" dr3 dr6      "")
  (COMMAND "LINE" dr33 dr66     "")
  (COMMAND "LINE" M   dr8      "")
  (COMMAND "LINE" M1  dr88     "")
  (COMMAND "LINE" dr4 dr44     "")
  (COMMAND "LINE" dr5 dr55     "")
  (COMMAND "LINE" dr6 dr66     "")
  (COMMAND "LINE" dr7 dr77     "")
  (COMMAND "LINE" dr8 dr88     "")
  (COMMAND "LINE" dr4 dr5      "")
  (COMMAND "LINE" dr44 dr55     "")
  (COMMAND "LINE" dr6 dr7      "")
  (COMMAND "LINE" dr66 dr77     "")
  (COMMAND "LINE" dr8  PP1 DR88 "")
  (COMMAND "LINE" CR1  CR11   "")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 (COMMAND "LAYER" "S" STOP2CNT "")
 (COMMAND "LINE" CR1  CR3 CR4 CR5 DR1 "")
 (COMMAND "LINE" CR11 CR33 CR44 CR55 DR11"")
 (COMMAND "LINE" CR2  gR2    "")
 (COMMAND "LINE" CR22 gR22   "")
;(COMMAND "LINE" DR1 DR11    "")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  (COMMAND "LAYER" "S" STOP2CEN  "")
  (COMMAND "LINE" PP11 PP22     "")
(COMMAND "LAYER" "S" NLY "")
              )
