(defun c:BLT8 ()
;(IF (= (TYPE F1) 'FILE ) "YES"  (STOP))
;(IF (= (TYPE F2) 'FILE ) "YES" (STOP))
(COMMAND "SETVAR" "CMDECHO" 0)
(SETQ NY (GETVAR "CLAYER"))
(setq BLSET (findfile "c:/acad/HON/SET/BL8.SET"))
(IF (= BLSET NIL)
    (PROGN
       (SETQ TEST 1)
       (PROMPT "\nPLEASE SETTING LAYER SKT-BLT :" )
       (SETQ FC (OPEN "c:/acad/HON/SET/BL8.SET" "w"))
       (setq BLCNT (GETSTRING T"\nSETTING SKT-BLT LAYER OF CONTNIUE LINE/<DRAW>:"))
       (IF (= BLCNT "")
              (WRITE-LINE "DRAW" FC)
              (WRITE-LINE BLCNT FC)
       )
       (setq BLCEN (GETSTRING T"\nSETTING SKT-BLT LAYER OF CENTER LINE/<CENTER>:"))
       (IF (= BLCEN "")
              (WRITE-LINE "CENTER" FC)
              (WRITE-LINE BLCEN FC)
       )
       (setq BLHID (GETSTRING T"\nSETTING SKT-BLT LAYER OF HIDDEN LINE/<HIDDEN>:"))
       (IF (= BLHID "")
              (WRITE-LINE "HIDDEN" FC)
              (WRITE-LINE BLHID FC)
       )
       (setq BLDIM (GETSTRING T"\nSETTING SKT-BLT LAYER OF DIMESION /<TEXT>:"))
       (IF (= BLDIM "")
              (WRITE-LINE "TEXT" FC)
              (WRITE-LINE BLDIM FC)
       )
       (setq BLTXT (GETSTRING T"\nSETTING SKT-BLT LAYER OF TEXT /<TEXT>:"))
       (IF (= BLTXT "")
              (WRITE-LINE "TEXT" FC)
              (WRITE-LINE BLTXT FC)
       )
       (CLOSE FC)
    )
)

(IF (/= BLSET NIL)
    (PROGN
       (SETQ FC (OPEN "c:/acad/HON/SET/BL8.SET" "r"))
       (SETQ BLCNT (READ-LINE FC))
       (SETQ BLCEN (READ-LINE FC))
       (SETQ BLHID (READ-LINE FC))
       (SETQ BLDIM (READ-LINE FC))
       (SETQ BLTXT (READ-LINE FC))
       (IF (OR (= BLCNT "") (= BLCEN "") (= BLHID "") (= BLDIM "") (= BLTXT "")
               (= BLCNT NIL) (= BLCEN NIL) (= BLHID NIL) (= BLDIM NIL) (= BLTXT NIL))
           (CLOSE FC)
       )
       (IF (OR (= BLCNT "") (= BLCEN "") (= BLHID "") (= BLDIM "") (= BLTXT "")
               (= BLCNT NIL) (= BLCEN NIL) (= BLHID NIL) (= BLDIM NIL) (= BLTXT NIL))
           (PROGN
              (PROMPT "\nPLEASE SETTING LAYER OF SCREW :" )
              (SETQ FC (OPEN "c:/acad/HON/SET/BL8.SET" "w"))
              (setq BLCNT (GETSTRING T"\nSETTING SKT-BLT LAYER OF CONTNIUE LINE/<DRAW>:"))
              (IF (= BLCNT "")
                  (WRITE-LINE "DRAW" FC)
                  (WRITE-LINE BLCNT FC)
              )
              (setq BLCEN (GETSTRING T"\nSETTING SKT-BLT LAYER OF CENTER LINE/<CENTER>:"))
              (IF (= BLCEN "")
                  (WRITE-LINE "CENTER" FC)
                  (WRITE-LINE BLCEN FC)
              )
              (setq BLHID (GETSTRING T"\nSETTING SKT-BLT LAYER OF HIDDEN LINE/<HIDDEN>:"))
              (IF (= BLHID "")
                  (WRITE-LINE "HIDDEN" FC)
                  (WRITE-LINE BLHID FC)
              )
              (setq BLDIM (GETSTRING T"\nSETTING SKT-BLT LAYER OF DIMESION/<TEXT>:"))
              (IF (= BLDIM "")
                  (WRITE-LINE "TEXT" FC)
                  (WRITE-LINE BLDIM FC)
              )
              (setq BLTXT (GETSTRING T"\nSETTING SKT-BLT LAYER OF TEXT /<TEXT>:"))
              (IF (= BLTXT "")
                  (WRITE-LINE "TEXT" FC)
                  (WRITE-LINE BLTXT FC)
              )
           (CLOSE FC)
           )
       )
       (SETQ FC (OPEN "c:/acad/HON/SET/BL8.SET" "r"))
       (SETQ BLCNT (READ-LINE FC))
       (SETQ BLCEN (READ-LINE FC))
       (SETQ BLHID (READ-LINE FC))
       (SETQ BLDIM (READ-LINE FC))
       (SETQ BLTXT (READ-LINE FC))
       (CLOSE FC)
       (PROMPT "\nSCREW CONTINUE OF LAYER IS:" )(PROMPT BLCNT)(TERPRI)
       (PROMPT "\nSCREW CENTER OF LAYER IS:" ) (PROMPT BLCEN)(TERPRI)
       (PROMPT "\nSCREW HIDDEN OF LAYER IS:" ) (PROMPT BLHID)(TERPRI)
       (PROMPT "\nSCREW DIMENSION OF LAYER IS:" ) (PROMPT BLDIM)(TERPRI)
       (PROMPT "\nSCREW TEXT   OF LAYER IS:" ) (PROMPT BLTXT)(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/BL8.SET" "w"))
       (PROMPT "\nSCREW CONTINUE OF LAYER <" )(PROMPT BLCNT)(PROMPT">:")
       (setq BLCNT (GETSTRING T))
       (IF (= BLCNT "")
              (WRITE-LINE "DRAW" FC)
              (WRITE-LINE BLCNT FC)
       )
       (PROMPT "\nSCREW CENTER OF LAYER <" )(PROMPT BLCEN)(PROMPT">:")
       (setq BLCEN (GETSTRING T))
       (IF (= BLCEN "")
              (WRITE-LINE "CENTER" FC)
              (WRITE-LINE BLCEN FC)
       )
       (PROMPT "\nSCREW HIDDEN OF LAYER <" )(PROMPT BLHID)(PROMPT">:")
       (setq BLHID (GETSTRING T))
       (IF (= BLHID "")
              (WRITE-LINE "HIDDEN" FC)
              (WRITE-LINE BLHID FC)
       )
       (PROMPT "\nSCREW DIMESION OF LAYER <" )(PROMPT BLDIM)(PROMPT">:")
       (setq BLDIM (GETSTRING T))
       (IF (= BLDIM "")
              (WRITE-LINE "TEXT" FC)
              (WRITE-LINE BLDIM FC)
       )
       (PROMPT "\nSCREW TEXT OF LAYER <" )(PROMPT BLTXT)(PROMPT">:")
       (setq BLTXT (GETSTRING T))
       (IF (= BLTXT "")
              (WRITE-LINE "TEXT" FC)
              (WRITE-LINE BLTXT FC)
       )
       (CLOSE FC)
       (SETQ FC (OPEN "c:/acad/HON/SET/BL8.SET" "r"))
       (SETQ BLCNT (READ-LINE FC))
       (SETQ BLCEN (READ-LINE FC))
       (SETQ BLHID (READ-LINE FC))
       (SETQ BLDIM (READ-LINE FC))
       (SETQ BLTXT (READ-LINE FC))
       (CLOSE FC)
       (PROMPT "\nSCREW CONTINUE OF LAYER NOW IS:" )(PROMPT BLCNT)(TERPRI)
       (PROMPT "\nSCREW CENTER   OF LAYER NOW IS:" ) (PROMPT BLCEN)(TERPRI)
       (PROMPT "\nSCREW HIDDEN   OF LAYER NOW IS:" ) (PROMPT BLHID)(TERPRI)
       (PROMPT "\nSCREW DIM      OF LAYER NOW IS:" ) (PROMPT BLDIM)(TERPRI)
       (PROMPT "\nSCREW TEXT     OF LAYER NOW  IS:" ) (PROMPT BLTXT)(TERPRI)
  )
)


;THE POINT IS FIST COUNTER Y THEN X
(MENUCMD "S=BLT")
(SETQ D (GETREAL"\nSelect dim:"))
(GRAPHSCR) (TERPRI)                                     ;GRAPHICS MODE
(SETQ ANS1 "N")
(IF (= D 3)
    (PROGN
       (SETQ D2 3.3)
       (SETQ BD1 5)
       (SETQ BD2 6)
       (SETQ H1  3)
       (SETQ H2  4)
       (SETQ SP 0.25)
       (SETQ SPP 0.5)
       (SETQ TTH 2.5)
    )
)
(IF (= D 4)
    (PROGN
       (SETQ D2 4.5)
       (SETQ BD1 6.5)
       (SETQ BD2 7.5)
       (SETQ H1  4)
       (SETQ H2  5)
       (SETQ SP 0.35)
       (SETQ SPP 0.7)
       (SETQ TTH 2.5)
    )
)
(IF (= D 5)
    (PROGN
       (SETQ D2 5.5)
       (SETQ BD1 8)
       (SETQ BD2 9)
       (SETQ H1  5)
       (SETQ H2  6.5)
       (SETQ SP 0.4)
       (SETQ SPP 1)
       (SETQ TTH 2.7)
    )
)
(IF (= D 6)
    (PROGN
       (SETQ D2 6.5)
       (SETQ BD1 10)
       (SETQ BD2 11)
       (SETQ H1  6)
       (SETQ H2  7.5)
       (SETQ SP 0.5)
       (SETQ SPP 1)
       (SETQ TTH 2.7)
    )
)
(IF (= D 8)
    (PROGN
       (SETQ D2 8.8)
       (SETQ BD1 13)
       (SETQ BD2 14)
       (SETQ H1  8)
       (SETQ H2  9.5)
       (SETQ SP 0.63)
       (SETQ SPP 1)
       (SETQ TTH 3)
    )
)
(IF (= D 10)
    (PROGN
       (SETQ D2 11)
       (SETQ BD1 16)
       (SETQ BD2 17.5)
       (SETQ H1  10)
       (SETQ H2  11.5)
       (SETQ SP 0.75)
       (SETQ SPP 1)
       (SETQ TTH 3)
    )
)
(IF (= D 12)
    (PROGN
       (SETQ D2 13)
       (SETQ BD1 18)
       (SETQ BD2 20)
       (SETQ H1  12)
       (SETQ H2  13.5)
       (SETQ SP 0.88)
       (SETQ SPP 1)
       (SETQ TTH 3)
    )
)
(IF (= D 14)
    (PROGN
       (SETQ D2 15.5)
       (SETQ BD1 21)
       (SETQ BD2 23)
       (SETQ H1  14)
       (SETQ H2  15.5)
       (SETQ SP 1.0)
       (SETQ SPP 1)
       (SETQ TTH 3)
    )
)
(IF (= D 16)
    (PROGN
       (SETQ D2 18)
       (SETQ BD1 24)
       (SETQ BD2 26)
       (SETQ H1  16)
       (SETQ H2  17.5)
       (SETQ SP 1.0)
       (SETQ SPP 1)
       (SETQ TTH 3)
    )
)
(IF (= D 20)
    (PROGN
       (SETQ D2 22)
       (SETQ BD1 28)
       (SETQ BD2 30)
       (SETQ H1  20)
       (SETQ H2  21.5)
       (SETQ SP 1.25)
       (SETQ SPP 1)
       (SETQ TTH 3)
    )
)
(IF (= D 22)
    (PROGN
   
