(DEFUN C:Q1 ()
(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=Q1")
   (COMMAND "VSLIDE" "C:/ACAD/HON/B/Q1")
(SETQ DIM (GETREAL"\nPLEASE SLECT THE DIM? OF THE BLOCK :(DIM1~DIM5)::"))
 (IF (= DIM 1 )
(PROGN
  ( SETQ A 15  )
  (SETQ B 16   )
  (SETQ D 10   )
  (SETQ E 15   )
  (SETQ X 0.5    )
  (SETQ W 8)
  (SETQ X1 0.3 )
            ))
 (IF (= DIM 2 )
(PROGN
  ( SETQ A 19  )
  (SETQ B 20   )
  (SETQ D 10   )
  (SETQ E 15   )
  (SETQ X 0.5    )
  (SETQ W  8 )
  (SETQ X1 0.3 )
            ))
 (IF (OR (= DIM 3) (= DIM NIL))
(PROGN
  ( SETQ A 19  )
  (SETQ B 20   )
  (SETQ D 10   )
  (SETQ E 15   )
  (SETQ X 0.5    )
  (SETQ W 10 )
  (SETQ X1 0.3 )
  ))
 (IF (= DIM 4 )
(PROGN
  ( SETQ A 24  )
  (SETQ B 25   )
  (SETQ D 10   )
  (SETQ E 15   )
  (SETQ X 0.5    )
  (SETQ W 10 )
  (SETQ X1 0.3 )
            ))
  (IF (= DIM 5 )
 (PROGN
   ( SETQ A 24  )
   (SETQ B 25   )
   (SETQ D 10   )
   (SETQ E 15   )
   (SETQ X 0.5    )
   (SETQ W 12 )
   (SETQ X1 0.3 )
             ))
   (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 U (DISTANCE P1 P2 ))
 (SETQ C U )
 ;;;;;;;;;;;;;;;;;;;RIGHT
 (SETQ DR1   (POLAR P1 (- AG1 AG2 ) ( /   A  2.0 ))      )
 (SETQ pp1  (POLAR P1    AG1  X  ))
 (SETQ DR2  (POLAR PP1 (- AG1 AG2) (/ B  2.0 )    ))
 (SETQ DR3  (POLAR DR2    AG1    (- C  x )        ))
 (SETQ pp2  (POLAR DR3 (+ AG1 AG2) (/ B  2.0)    ))
 (SETQ DR4  (POLAR PP2 (- AG1 AG2) (/ W  2.0)    ))
 (SETQ DR5  (POLAR DR4    AG1     (- D X1 )            ))
 (SETQ DR6  (POLAR DR4    AG1      E             ))
 (SETQ DR55 (POLAR DR5 (+ AG1 AG2) X1            ))
 (SETQ DR555 (POLAR DR55     AG1     X1             ))
 (SETQ LENGTH (* (/ 1.0 ( SIN (DTR 60 ))) ( / W 2.0 )              ))
 (SETQ P3    (POLAR DR6 (+   AG1 ( DTR 60 ))  LENGTH         ))
 ;;;;;;;;;;;;;;;LEFT
 (SETQ DR11  (POLAR P1 (+ AG1 AG2 ) ( /   A  2.0 ))      )
 (SETQ DR22 (POLAR PP1 (+ AG1 AG2) (/ B  2.0 )    ))
 (SETQ DR33 (POLAR DR22   AG1  (-  C  x )        ))
 (SETQ DR44 (POLAR PP2 (+ AG1 AG2) (/ W  2.0)    ))
 (SETQ DR5I (POLAR DR44   AG1     (- D X1 )            ))
 (SETQ DR66 (POLAR DR44   AG1      E             ))
 (SETQ DR55I (POLAR DR5I (-  AG1 AG2) X1            ))
 (SETQ DR555I (POLAR DR55I     AG1     X1             ))
;;;;;;;;;;;;;;;;;;;;hid LINE
 (COMMAND "LAYER" "S" STOP2hid  "")
 (COMMAND "LINE" DR1  DR2 DR3 "")
 (COMMAND "LINE"  DR4 DR5 DR6 P3 DR66 DR5I DR44 "")
 (COMMAND "LINE" DR11 DR22 DR33 "")
 (COMMAND "LINE" DR2  DR22  "")
 (COMMAND "LINE" DR5  DR5I  "")
 (COMMAND "LINE" DR555 DR555I "")
 (COMMAND "LINE" DR6  DR66  "")
 (COMMAND "LINE" DR5  DR555 "")
 (COMMAND "LINE" DR5I  DR555I "")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CEN
 (SETQ P4   (POLAR P3     AG1      1.0           ))
 (SETQ P5   (POLAR P1   (+ AG1 PI)    1.0             ))
 (COMMAND "LAYER" "S" STOP2CEN  "")
 (COMMAND "LINE" P4  P5     "")
 (COMMAND "LAYER" "S" NLY "")
 )
