(DEFUN C:Q2()
;(COMMAND "LAYER" "S" "0" "")
;(COMMAND "VSLIDE" "STOP2" )
(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=d11")
   (COMMAND "VSLIDE" "C:/ACAD/HON/B/Q2")
 (SETQ DIM (GETREAL"\nPLEASE SLECT THE DIM OF THE ENTITY:(DIM1)" ))
 (IF (OR ( = DIM "" ) (= DIM NIL ) )
     (PROGN
     (SETQ DIM 1 )
 ))
 (IF (= DIM 1 )
    (PROGN
       ( SETQ A 3.12 )
       ( SETQ B 2.43 )
       ( SETQ L 9.5  )
       ( SETQ R1 10.0 )
       ( SETQ R2 11.0 )
      ))
 (IF (= DIM 2 )
    (PROGN
       ( SETQ A 3.2  )
       ( SETQ B 2.53 )
       ( SETQ L 10.5  )
       ( SETQ R1 11.0 )
       ( SETQ R2 12.0 )
      ))
 (IF (= DIM 3 )
    (PROGN
       ( SETQ A 6.78 )
       ( SETQ B 1.7  )
       ( SETQ L 10.5  )
       ( SETQ R1 12.5 )
       ( SETQ R2 13.5 )
      ))
 (IF (= DIM 4 )
    (PROGN
       ( SETQ A 7.62 )
       ( SETQ B 1.87 )
       ( SETQ L 13.5  )
       ( SETQ R1 15.5 )
       ( SETQ R2 16.5 )
      ))
 (IF (= DIM 5 )
 (PRGON
       ( SETQ A 7.19 )
       ( SETQ B 2.23 )
       ( SETQ L 16.5  )
       ( SETQ R1 18.0 )
       ( SETQ R2 19.0 )
      ))
 (IF (= DIM 6 )
    (PROGN
       ( SETQ A 7.7  )
       ( SETQ B 2.9  )
       ( SETQ L 19.0  )
       ( SETQ R1 20.5 )
       ( SETQ R2 21.5 )
      ))

   (COMMAND "REDRAW")
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  (SETQ P1 (GETPOINT"\n SLECT P1 BASE POINT:"))
  (SETQ P2 (GETPOINT P1"\n SELECT P2 BASE POINT:"))
  (SETQ AG1 (ANGLE P1 P2 ) )
  (SETQ AG2 (* PI 0.5 ))
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 (SETQ DR1   (POLAR P1 (- AG1 AG2 )   L           ))
 (SETQ DR2   (POLAR DR1    AG1        A            ))
 (SETQ DR3   (POLAR DR2    AG1        B            )      )
 (SETQ DR11  (POLAR P1 (+ AG1 AG2 )    L          ))
 (SETQ DR22  (POLAR DR11   AG1         A           ))
 (SETQ DR33  (POLAR DR22   AG1        B            )      )
 (COMMAND "LAYER" "S" STOP2hid"")
 (COMMAND "ARC" DR3 "E" DR33 "R" R2   )
 (COMMAND "ARC" DR2  "E" DR22 "R" R1  )
 (COMMAND "LINE" DR1  DR3      "")
 (COMMAND "LINE" DR11 DR33           "")
 (SETQ CR1   (POLAR P1 (- AG1 AG2 )      L        ))
 (SETQ CR2   (POLAR CR1 (+ AG1 PI )      A         ))
 (SETQ CR3   (POLAR CR2 (+ AG1 PI )     B          )      )
 (SETQ CR11  (POLAR P1 (+ AG1 AG2 )      L        ))
 (SETQ CR22  (POLAR CR11 (+ AG1 PI )          A         ))
 (SETQ CR33  (POLAR CR22 (+  AG1 PI )         B          )      )
 (COMMAND "ARC" CR33"E" CR3  "R" R2   )
 (COMMAND "ARC" CR22 "E" CR2  "R" R1  )
 (COMMAND "LINE" CR1  CR3      "")
 (COMMAND "LINE" CR11 CR33     "")
 (COMMAND "LAYER" "S" STOP2CEN"")
 (SETQ PP1   (POLAR CR1 (- AG1 AG2 )      1.0        ))
 (SETQ PP2   (POLAR CR11 (+ AG1 AG2 )     1.0       )      )
 (SETQ PP4   (POLAR P1 (+ AG1 PI  )     12        ))
 (SETQ PP3   (POLAR P1      AG1               12        ))
 (COMMAND "LINE" PP1  PP2      "")
 (COMMAND "LINE" PP3  PP4      "")
 (COMMAND "LAYER" "S" NLY "")
 )
