(DEFUN C:STRAI1()
;SET LAYER
(COMMAND "SETVAR" "CMDECHO" 0)
(SETQ NY (GETVAR "CLAYER"))
(SETQ LTA (GETVAR "LASTANGLE"))
;(IF (= (TYPE F1) 'FILE ) "YES"  (STOP))
;(IF (= (TYPE F2) 'FILE ) "YES" (STOP))
(setq STRSET (findfile "C:/ACAD/HON/SET/STR1.SET"))
(IF (= STRSET NIL)
    (PROGN
       (PROMPT "\nPLEASE SETTING LAYER GIUDE PIN :" )
       (SETQ FC (OPEN "C:/ACAD/HON/SET/STR1.SET" "w"))
       (setq STRCNT (GETSTRING T"\nSETTING LAYER OF CONTNIUE LINE ? <0>:"))
       (IF (= STRCNT "")
              (WRITE-LINE "0" FC)
              (WRITE-LINE STRCNT FC)
       )
       (setq STRCEN (GETSTRING T"\nSETTING  LAYER OF CENTER LINE ? <CEN>:"))
       (IF (= STRCEN "")
              (WRITE-LINE "CEN" FC)
              (WRITE-LINE STRCEN FC)
       )
       (setq STRHID (GETSTRING T"\nSETTING LAYER OF HIDDEN LINE ? <HID>:"))
       (IF (= STRHID "")
              (WRITE-LINE "HID" FC)
              (WRITE-LINE STRHID FC)
       )
       (CLOSE FC)
    )
)

(IF (/= STRSET NIL)
    (PROGN
       (SETQ FC (OPEN "C:/ACAD/HON/SET/STR1.SET" "r"))
       (SETQ STRCNT (READ-LINE FC))
       (SETQ STRCEN (READ-LINE FC))
       (SETQ STRHID (READ-LINE FC))
       (IF (OR (= STRCNT "") (= STRCEN "") (= STRHID "")
               (= STRCNT NIL) (= STRCEN NIL) (= STRHID NIL))
           (CLOSE FC)
       )
       (IF (OR (= STRCNT "") (= STRCEN "") (= STRHID "")
               (= STRCNT NIL) (= STRCEN NIL) (= STRHID NIL))
           (PROGN
              (PROMPT "\nPLEASE SETTING LAYER :" )
              (SETQ FC (OPEN "C:/ACAD/HON/SET/STR1.SET" "w"))
              (setq STRCNT (GETSTRING T"\nSETTING LAYER OF CONTNIUE LINE ? <0>:"))
              (IF (= STRCNT "")
                  (WRITE-LINE "0" FC)
                  (WRITE-LINE STRCNT FC)
              )
              (setq STRCEN (GETSTRING T"\nSETTING LAYER OF CENTER LINE ? <CEN>:"))
              (IF (= STRCEN "")
                  (WRITE-LINE "CEN" FC)
                  (WRITE-LINE STRCEN FC)
              )
              (setq STRHID (GETSTRING T"\nSETTING LAYER OF HIDDEN LINE ? <HID>:"))
              (IF (= STRHID "")
                  (WRITE-LINE "HID" FC)
                  (WRITE-LINE STRHID FC)
              )
           (CLOSE FC)
           )
       )
       (SETQ FC (OPEN "C:/ACAD/HON/SET/STR1.SET" "r"))
       (SETQ STRCNT (READ-LINE FC))
       (SETQ STRCEN (READ-LINE FC))
       (SETQ STRHID (READ-LINE FC))
       (CLOSE FC)
       (PROMPT "\nCONTINUE OF LAYER IS:" )(PROMPT STRCNT)(TERPRI)
       (PROMPT "\nCENTER OF LAYER IS:" ) (PROMPT STRCEN)(TERPRI)
       (PROMPT "\nHIDDEN OF LAYER IS:" ) (PROMPT STRHID)(TERPRI)
    )
)

;THE POINT IS FIST COUNTER Y THEN X
(MENUCMD "S=STR")
;(COMMAND "UJ" "")
(GRAPHSCR) (TERPRI)                                     ;GRAPHICS MODE
(SETQ D (GETREAL"\nSelect dim:"))
(SETQ ANS1 "Y")
(IF (= D 3)
    (SETQ C  0.5)
)
(IF (AND (>= D 4) (<= D 10))
    (SETQ C  1)
)
(IF (AND (>= D 12) (<= D 30))
    (SETQ C  1.5)
)
(SETQ P1 (GETPOINT "\nP1:"))
(SETQ P2 (GETPOINT P1 "\nP2:"))
(SETQ AG1 (ANGLE P1 P2))
(SETQ AG2 (* PI 0.5))
(SETQ LST (DISTANCE P1 P2)) ;DIST FOR P1 P2
(SETQ DR1 (POLAR (POLAR P1 AG1 0) (+ AG1 AG2) (- (/ D 2.0) C)))
(SETQ DR2 (POLAR (POLAR P1 AG1 0) (- AG1 AG2) (- (/ D 2.0) C)))
(SETQ DR3 (POLAR (POLAR P1 AG1 C) (+ AG1 AG2) (/ D 2.0)))
(SETQ DR4 (POLAR (POLAR P1 AG1 C) (- AG1 AG2) (/ D 2.0)))
(SETQ DR5 (POLAR (POLAR P1 AG1 (- LST C)) (+ AG1 AG2) (/ D 2.0)))
(SETQ DR6 (POLAR (POLAR P1 AG1 (- LST C)) (- AG1 AG2) (/ D 2.0)))
(SETQ DR7 (POLAR (POLAR P1 AG1 LST) (+ AG1 AG2) (- (/ D 2.0) C)))
(SETQ DR8 (POLAR (POLAR P1 AG1 LST) (- AG1 AG2) (- (/ D 2.0) C)))

;ABOVE FIRST BOX
(IF  (= ANS1 "N")
     (COMMAND "LAYER" "SET" STRHID "")
     (COMMAND "LAYER" "SET" STRCNT "")
)
(COMMAND "LINE" DR1 DR3 "")
(COMMAND "LINE" DR2 DR4 "")
(COMMAND "LINE" DR3 DR4 "")
(COMMAND "LINE" DR5 DR7 "")
(COMMAND "LINE" DR6 DR8 "")
(COMMAND "LINE" DR5 DR6 "")
(COMMAND "LINE" DR3 DR5 "")
(COMMAND "LINE" DR4 DR6 "")
;BOX ABOVE

;(IF (= ANS1 "Y")
;    (COMMAND "BREAK" (POLAR P2 (+ AG1 AG2) 4) "F" (POLAR P2 (+ AG1 AG2) (* D 0.5))
;    (POLAR P2 (- AG1 AG2) (* D 0.5)))
;)
(COMMAND "LAYER" "SET" STRCEN "")
(COMMAND "LINE" (POLAR P1 AG1 -1) (POLAR P1 AG1 (+ 1 LST)) "")
(COMMAND "LAYER" "SET" NY "")
)
