(DEFUN C:EJB ()
;SET LAYER
(COMMAND "SETVAR" "CMDECHO" 0)
(SETQ NY (GETVAR "CLAYER"))
;(IF (= (TYPE F1) 'FILE ) "YES"  (STOP))
;(IF (= (TYPE F2) 'FILE ) "YES" (STOP))
(setq EJSET (findfile "C:/ACAD/ACAD/SUPPORT/EJ.SET"))
(IF (= EJSET NIL)
    (PROGN
       (PROMPT "\nPLEASE SETTING LAYER E.J PIN :" )
       (SETQ FC (OPEN "C:/ACAD/ACAD/SUPPORT/EJ.SET" "w"))
       (setq EJCNT (GETSTRING T"\nSETTING E.J PIN  LAYER OF CONTNIUE LINE/<DRAW>:"))
       (IF (= EJCNT "")
              (WRITE-LINE "DRAW" FC)
              (WRITE-LINE EJCNT FC)
       )
       (setq EJCEN (GETSTRING T"\nSETTING E.J PIN LAYER OF CENTER LINE/<CENTER>:"))
       (IF (= EJCEN "")
              (WRITE-LINE "CENTER" FC)
              (WRITE-LINE EJCEN FC)
       )
       (setq EJHID (GETSTRING T"\nSETTING E.J PIN LAYER OF HIDDEN LINE/<HIDDEN>:"))
       (IF (= EJHID "")
              (WRITE-LINE "HIDDEN" FC)
              (WRITE-LINE EJHID FC)
       )
       (setq EJDIM (GETSTRING T"\nSETTING E.J PIN LAYER OF DIMENSION LINE/<TEXT>:"))
       (IF (= EJDIM "")
              (WRITE-LINE "TEXT" FC)
              (WRITE-LINE EJDIM FC)
       )
       (CLOSE FC)
    )
)

(IF (/= EJSET NIL)
    (PROGN
       (SETQ FC (OPEN "C:/ACAD/ACAD/SUPPORT/EJ.SET" "r"))
       (SETQ EJCNT (READ-LINE FC))
       (SETQ EJCEN (READ-LINE FC))
       (SETQ EJHID (READ-LINE FC))
       (SETQ EJDIM (READ-LINE FC))
       (IF (OR (= EJCNT "") (= EJCEN "") (= EJHID "") (= EJDIM "")
               (= EJCNT NIL) (= EJCEN NIL) (= EJHID NIL) (= EJDIM NIL))
           (CLOSE FC)
       )
       (IF (OR (= EJCNT "") (= EJCEN "") (= EJHID "") (= EJDIM "")
               (= EJCNT NIL) (= EJCEN NIL) (= EJHID NIL) (= EJDIM NIL))
           (PROGN
              (PROMPT "\nPLEASE SETTING LAYER E.J PIN :" )
              (SETQ FC (OPEN "C:/ACAD/ACAD/SUPPORT/EJ.SET" "w"))
              (setq EJCNT (GETSTRING T"\nSETTING E.J PIN  LAYER OF CONTNIUE LINE/<DRAW>:"))
              (IF (= EJCNT "")
                  (WRITE-LINE "DRAW" FC)
                  (WRITE-LINE EJCNT FC)
              )
              (setq EJCEN (GETSTRING T"\nSETTING GUIDE PIN LAYER OF CENTER LINE/<CENTER>:"))
              (IF (= EJCEN "")
                  (WRITE-LINE "CENTER" FC)
                  (WRITE-LINE EJCEN FC)
              )
              (setq EJHID (GETSTRING T"\nSETTING E.J PIN LAYER OF HIDDEN LINE/<HIDDEN>:"))
              (IF (= EJHID "")
                  (WRITE-LINE "HIDDEN" FC)
                  (WRITE-LINE EJHID FC)
              )
              (setq EJDIM (GETSTRING T"\nSETTING E.J PIN LAYER OF DIMENSION /<DIM1>:"))
              (IF (= EJDIM "")
                  (WRITE-LINE "TEXT" FC)
                  (WRITE-LINE EJDIM FC)
              )
           (CLOSE FC)
           )
       )
       (SETQ FC (OPEN "C:/ACAD/ACAD/SUPPORT/EJ.SET" "r"))
       (SETQ EJCNT (READ-LINE FC))
       (SETQ EJCEN (READ-LINE FC))
       (SETQ EJHID (READ-LINE FC))
       (SETQ EJDIM (READ-LINE FC))
       (CLOSE FC)
       (PROMPT "\nE.J CONTINUE OF LAYER IS:" )(PROMPT EJCNT)(TERPRI)
       (PROMPT "\nE.J CENTER OF LAYER IS:" ) (PROMPT EJCEN)(TERPRI)
       (PROMPT "\nE.J HIDDEN OF LAYER IS:" ) (PROMPT EJHID)(TERPRI)
       (PROMPT "\nE.J DIMENSION OF LAYER IS:" ) (PROMPT EJDIM)(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/ACAD/SUPPORT/EJ.SET" "w"))
       (PROMPT "\nE.J CONTINUE OF LAYER <" )(PROMPT EJCNT)(PROMPT">:")
       (setq EJCNT (GETSTRING T))
       (IF (= EJCNT "")
              (WRITE-LINE "DRAW" FC)
              (WRITE-LINE EJCNT FC)
       )
       (PROMPT "\nE.J CENTER OF LAYER <" )(PROMPT EJCEN)(PROMPT">:")
       (setq EJCEN (GETSTRING T))
       (IF (= EJCEN "")
              (WRITE-LINE "CENTER" FC)
              (WRITE-LINE EJCEN FC)
       )
       (PROMPT "\nE.J HIDDEN OF LAYER <" )(PROMPT EJHID)(PROMPT">:")
       (setq EJHID (GETSTRING T))
       (IF (= EJHID "")
              (WRITE-LINE "HIDDEN" FC)
              (WRITE-LINE EJHID FC)
       )
       (PROMPT "\nE.J DIMENSION LAYER <" )(PROMPT EJDIM)(PROMPT">:")
       (setq EJDIM (GETSTRING T))
       (IF (= EJDIM "")
              (WRITE-LINE "TEXT" FC)
              (WRITE-LINE EJDIM FC)
       )
       (CLOSE FC)
       (SETQ FC (OPEN "C:/ACAD/ACAD/SUPPORT/EJ.SET" "r"))
       (SETQ EJCNT (READ-LINE FC))
       (SETQ EJCEN (READ-LINE FC))
       (SETQ EJHID (READ-LINE FC))
       (SETQ EJDIM (READ-LINE FC))
       (CLOSE FC)
       (PROMPT "\nE.J CONTINUE OF LAYER NOW IS:" )(PROMPT EJCNT)(TERPRI)
       (PROMPT "\nE.J CENTER   OF LAYER NOW IS:" ) (PROMPT EJCEN)(TERPRI)
       (PROMPT "\nE.J HIDDEN   OF LAYER NOW IS:" ) (PROMPT EJHID)(TERPRI)
       (PROMPT "\nE.J DIMENSION OF LAYER IS:" ) (PROMPT EJDIM)(TERPRI)
  )
)


;THE POINT IS FIST COUNTER Y THEN X
(COMMAND "LAYER" "SET" EJCNT "")
(MENUCMD "S=JP")
;(COMMAND "UJ" "")
(GRAPHSCR) (TERPRI)
(SETQ D (GETREAL"\nSelect dim:"))
(IF  (= (SETQ ANS1 (GETSTRING "\nDOU YOU WANT TO TRIM LINE:<Y>")) "")
     (SETQ ANS1 "Y"))
(SETQ ANS1 (STRCASE ANS1))

(IF (AND (> D 0 ) (< D 1))
    (PROGN
       (SETQ BD1 3)
       (SETQ BD 6)
       (SETQ H  4)
     )
)
(IF (AND (> D 1 ) (< D 2))
    (PROGN
       (SETQ BD1 3)
       (SETQ BD 6)
       (SETQ H  4)
     )
)
(IF (AND (> D 2 ) (<= D 3))
    (PROGN
       (SETQ BD1 4)
       (SETQ BD 8)
       (SETQ H  4)
     )
)
(IF (> D 3 )
    (PROGN
       (SETQ BD1 (+ D 3))
       (SETQ BD (+ D 8))
       (SETQ H  6)
     )
)



(SETQ P1 (GETPOINT "\nP1:"))
(SETQ P2 (GETPOINT P1 "\nP2:"))
(SETQ P3 (GETPOINT P2 "\nP3:"))
(SETQ P4 (GETPOINT P3 "\nP4:"))
(COMMAND "OSNAP" "NONE" )
(SETQ ag1 (ANGLE P1 P2))
(SETQ AG2 (* PI 0.5))
(SETQ DR1 (POLAR (POLAR P1 AG1 H) (+ AG1 AG2) (+ (/ BD 2.0) 0.5)))
(SETQ DR2 (POLAR (POLAR P1 AG1 H) (- AG1 AG2) (+ (/ BD 2.0) 0.5)))
(SETQ DR3 (POLAR P1 (+ AG1 AG2) (+ (/ BD 2.0) 0.5)))
(SETQ DR4 (POLAR P1 (- AG1 AG2) (+ (/ BD 2.0) 0.5)))
(SETQ DR5 (POLAR (POLAR P1 AG1 H) (+ AG1 AG2) (/ BD 2.0)))
(SETQ DR6 (POLAR (POLAR P1 AG1 H) (- AG1 AG2) (/ BD 2.0)))
(SETQ DR7 (POLAR P1 (+ AG1 AG2) (/ BD 2.0)))
(SETQ DR8 (POLAR P1 (- AG1 AG2) (/ BD 2.0)))
;
;ABOVE FIRST BOX
(SETQ LSE (DISTANCE P1 P4)) ;DIST FOR P1 P4
(SETQ LST (DISTANCE P1 P2)) ;DIST FOR P1 P2
(SETQ LS3 (DISTANCE P1 P3)) ;DIST FOR P1 P3
(SETQ LS4 (DISTANCE P3 P4)) ;DIST FOR P3 P4
(SETQ LS2 (DISTANCE P2 P3)) ;DIST FOR P2 P3
;
(SETQ DR9 (POLAR (POLAR P1 AG1  H )  (+ AG1 AG2) (/ BD1 2.0)))
(SETQ DR10 (POLAR (POLAR P1 AG1 H ) (- AG1 AG2) (/ BD1 2.0)))
(SETQ DR9-1 (POLAR (POLAR P1 AG1  LST ) (+ AG1 AG2) (/ BD1 2.0)))
(SETQ DR10-1 (POLAR (POLAR P1 AG1 LST ) (- AG1 AG2) (/ BD1 2.0)))

(SETQ DR11 (POLAR (POLAR P1 AG1  (- LSE LS2 20)) (+ AG1 AG2) (/ BD1 2.0)))
(SETQ DR12 (POLAR (POLAR P1 AG1  (- LSE LS2 20)) (- AG1 AG2) (/ BD1 2.0)))
(SETQ DR13 (POLAR (POLAR P1 AG1 H) (+ AG1 AG2) (+ (/ BD1 2.0) 0.5)))
(SETQ DR14 (POLAR (POLAR P1 AG1 H) (- AG1 AG2) (+ (/ BD1 2.0) 0.5)))
(SETQ DR15 (POLAR (POLAR P1 AG1 LST) (+ AG1 AG2) (+ (/ BD1 2.0) 0.5)))
(SETQ DR16 (POLAR (POLAR P1 AG1 LST) (- AG1 AG2) (+ (/ BD1 2.0) 0.5)))
(SETQ DR15-1 (POLAR (POLAR P1 AG1 LST) (+ AG1 AG2) (/ D 2.0)))
(SETQ DR16-1 (POLAR (POLAR P1 AG1 LST) (- AG1 AG2) (/ D 2.0)))
;(SETQ DR17 (POLAR (POLAR P1 AG1 (- LSE LS2 16)) (+ AG1 AG2) (/ D 2.0)))
(SETQ DR17-1 (POLAR (POLAR P1 AG1 (- LSE LS2 16)) (+ AG1 AG2) (+ (/ D 2.0) 6)))
(SETQ DR17-11 (POLAR (POLAR P1 AG1 (- LSE LS2 15)) (+ AG1 AG2) (+ (/ D 2.0) 6)))

(SETQ DR18-1 (POLAR (POLAR P1 AG1 (- LSE LS2 16)) (- AG1 AG2) (+ (/ D 2.0) 6)))
(SETQ DR18-11 (POLAR (POLAR P1 AG1 (- LSE LS2 15)) (- AG1 AG2) (+ (/ D 2.0) 6)))

(IF (<= LS4 20)
    (PROGN
      (SETQ DR11 (POLAR (POLAR P1 AG1 (- LST 5)) (+ AG1 AG2) (/ BD1 2.0)))
      (SETQ DR12 (POLAR (POLAR P1 AG1 (- LST 5)) (- AG1 AG2) (/ BD1 2.0)))
    )
)
(SETQ LP (GETVAR "LUPREC"))   ;LP DIGITAL
(COMMAND "SETVAR" "LUPREC" 4)   ;LP DIGITAL
(SETQ NUP 1000)
(SETQ B (DTR (- AG1 AG2)))
(WHILE  (/= NUP 0)
    (SETQ DR18-2 (POLAR DR12 (DTR B) 6))
    (SETQ DR18-2X (CAR DR18-2))
    (SETQ DR18-2Y (CADR DR18-2))
    (SETQ DR18-2X1 (RTOS DR18-2X 2 4))
    (SETQ DR18-2Y1 (RTOS DR18-2Y 2 4))
    (SETQ DR18-2X2 (ATOF DR18-2X1))
    (SETQ DR18-2Y2 (ATOF DR18-2Y1))
    (SETQ DR18-2 (LIST DR18-2X2 DR18-2Y2))
    (SETQ DR18INT (INTERS DR18-1 DR18-11 DR12 DR18-2 NIL))
    (SETQ TT (ABS (- 6 (DISTANCE DR18INT DR12))))
    (IF (< TT 0.01)
        (PROGN
          (PROMPT "\n IS HERE1")
          (SETQ NUP 0)
          (SETQ DR18 (POLAR DR18INT (+ AG1 AG2) 6))
        )
    )
    (SETQ B (+ B 0.1))
)

(SETQ NUP1 1000)
(SETQ B1 (DTR (+ AG1 AG2)))
(WHILE  (/= NUP1 0)
    (SETQ DR17-2 (POLAR DR11 (DTR B1) 6))
    (SETQ DR17-2X (CAR DR17-2))
    (SETQ DR17-2Y (CADR DR17-2))
    (SETQ DR17-2X1 (RTOS DR17-2X 2 4))
    (SETQ DR17-2Y1 (RTOS DR17-2Y 2 4))
    (SETQ DR17-2X2 (ATOF DR17-2X1))
    (SETQ DR17-2Y2 (ATOF DR17-2Y1))
    (SETQ DR17-2 (LIST DR17-2X2 DR17-2Y2))
    (SETQ DR17INT (INTERS DR17-1 DR17-11 DR11 DR17-2 NIL))
    (SETQ TT1 (ABS (- 6 (DISTANCE DR17INT DR11))))
    (IF (< TT1 0.01)
        (PROGN
          (PROMPT "\n IS HERE2")
          (SETQ NUP1 0)
          (SETQ DR17 (POLAR DR17INT (+ AG1 AG2) -6))
        )
    )
    (SETQ B1 (- B1 0.1))
)















(COMMAND "SETVAR" "LUPREC" LP)   ;LP DIGITAL
;(SETQ DR18 (POLAR (POLAR P1 AG1 (- LSE LS2 16)) (- AG1 AG2) (/ D 2.0)))
(SETQ DR19 (POLAR (POLAR P1 AG1 LSE) (+ AG1 AG2) (/ D 2.0)))
(SETQ DR20 (POLAR (POLAR P1 AG1 LSE) (- AG1 AG2) (/ D 2.0)))
(SETQ DR21 (POLAR (POLAR P1 AG1 LS3) (+ AG1 AG2) (+ (/ BD1 2.0) 0.5)))
(SETQ DR22 (POLAR (POLAR P1 AG1 LS3) (- AG1 AG2) (+ (/ BD1 2.0) 0.5)))
(SETQ DR21-1 (POLAR (POLAR P1 AG1 LS3) (+ AG1 AG2) (/ D 2.0)))
(SETQ DR22-1 (POLAR (POLAR P1 AG1 LS3) (- AG1 AG2) (/ D 2.0)))
(SETQ DR23 (POLAR (POLAR P1 AG1 (- LSE 15)) (+ AG1 AG2) (+ (/ BD1 2.0) 0.5)))
(SETQ DR24 (POLAR (POLAR P1 AG1 (- LSE 15)) (- AG1 AG2) (+ (/ BD1 2.0) 0.5)))
(SETQ DR25 (POLAR (POLAR P1 AG1 (- LSE 15)) (+ AG1 AG2) (/ D 2.0)))
(SETQ DR26 (POLAR (POLAR P1 AG1 (- LSE 15)) (- AG1 AG2) (/ D 2.0)))
(SETQ DR27 (POLAR DR23 (DTR 30)  10))
(SETQ DR28 (POLAR DR24 (DTR 150) 10))

(IF (= ANS1 "Y")
    (PROGN
       (SETQ P2N (POLAR P2 (+ AG1 AG2) 4))
       (COMMAND "SELECT" P2N "")
       (SETQ SA (SSGET "P" ))
       (SETQ N (SSLENGTH SA))
       (SETQ I 0)
       (SETQ NB (ASSOC 0 NA))
       (SETQ NA (ENTGET (SSNAME SA I)))
       (SETQ NP11 (ASSOC 10 NA))
       (SETQ NP12 (ASSOC 11 NA))
       (SETQ LA1 (ASSOC 8 NA))
       (SETQ LA11 (CDR LA1))
       (SETQ NP1 (CDR NP11))
       (SETQ NP2 (CDR NP12))
       (SETQ TR1 NP1)
       (SETQ TR2 NP2)
       (COMMAND "ERASE" P2N "")
       (IF (> (CAR TR1) (CAR TR2))
          (PROGN
             (SETQ TR1 NP2)
             (SETQ TR2 NP1)
          )
       )
    )
)

(IF (= ANS1 "Y")
    (PROGN
       (SETQ P3N (POLAR P3 (+ AG1 AG2) 4))
       (COMMAND "SELECT" P3N "")
       (SETQ SA (SSGET "P" ))
       (SETQ N (SSLENGTH SA))
       (SETQ I 0)
       (SETQ NB (ASSOC 0 NA))
       (SETQ NA (ENTGET (SSNAME SA I)))
       (SETQ NP11 (ASSOC 10 NA))
       (SETQ NP12 (ASSOC 11 NA))
       (SETQ LA2 (ASSOC 8 NA))
       (SETQ LA21 (CDR LA2))
       (SETQ NP1 (CDR NP11))
       (SETQ NP2 (CDR NP12))
       (SETQ TR3 NP1)
       (SETQ TR4 NP2)
       (COMMAND "ERASE" P3N "")
       (IF (> (CAR TR3) (CAR TR4))
          (PROGN
             (SETQ TR3 NP2)
             (SETQ TR4 NP1)
          )
       )
    )
)

(SETQ INT1 (INTERS DR17 DR19 DR23 DR27 NIL))
(SETQ INT2 (INTERS DR18 DR20 DR24 DR28 NIL))

(IF  (AND (= ANS1 "N") (> LS4 20))
     (PROGN
        (COMMAND "LAYER" "SET" EJHID "")
        (COMMAND "LINE" DR1 DR2 "")
        (COMMAND "LINE" DR1 DR3 "")
        (COMMAND "LINE" DR2 DR4 "")
        (COMMAND "LINE" DR5 DR7 "")
        (COMMAND "LINE" DR6 DR8 "")
        (COMMAND "LINE" DR13 DR15 "")
        (COMMAND "LINE" DR14 DR16 "")
        (COMMAND "LINE" DR21 DR23 "")
        (COMMAND "LINE" DR22 DR24 "")
        (COMMAND "LINE" DR23 DR25 "")
        (COMMAND "LINE" DR24 DR26 "")
        (COMMAND "LINE" INT1 DR23 "")
        (COMMAND "LINE" INT2 DR24 "")
        (COMMAND "LINE" DR9 DR9-1 "")
        (COMMAND "LINE" DR10 DR10-1 "")
        (COMMAND "LAYER" "SET" EJCNT "")
        (COMMAND "ARC" DR11 "E" DR17 "R" 6)
        (COMMAND "ARC" DR18 "E" DR12 "R" 6)
        (COMMAND "LINE" DR9-1 DR11 "")
        (COMMAND "LINE" DR10-1 DR12 "")
        (COMMAND "LINE" DR17 DR21-1 "")
        (COMMAND "LINE" DR18 DR22-1 "")
        (COMMAND "LINE" DR11 DR12 "")
        (COMMAND "LAYER" "SET" EJHID "")
        (COMMAND "LINE" DR21-1 DR19 "")
        (COMMAND "LINE" DR22-1 DR20 "")
     )
)

(IF  (AND (= ANS1 "Y") (> LS4 20))
     (PROGN
        (COMMAND "LAYER" "SET" EJCNT "")
        (COMMAND "LINE" DR1 DR2 "")
        (COMMAND "LINE" DR1 DR3 "")
        (COMMAND "LINE" DR2 DR4 "")
        (COMMAND "LINE" DR5 DR7 "")
        (COMMAND "LINE" DR6 DR8 "")
        (COMMAND "LINE" DR13 DR15 "")
        (COMMAND "LINE" DR14 DR16 "")
        (COMMAND "LINE" DR21 DR23 "")
        (COMMAND "LINE" DR22 DR24 "")
        (COMMAND "LINE" DR23 DR25 "")
        (COMMAND "LINE" DR24 DR26 "")
        (COMMAND "LINE" INT1 DR23 "")
        (COMMAND "LINE" INT2 DR24 "")
        (COMMAND "LINE" DR9 DR11 "")
        (COMMAND "LINE" DR10 DR12 "")
        (COMMAND "LINE" DR17 DR19 "")
        (COMMAND "LINE" DR18 DR20 "")
        (COMMAND "LINE" DR11 DR12 "")
        (COMMAND "ARC" DR11 "E" DR17 "R" 6)
        (COMMAND "ARC" DR18 "E" DR12 "R" 6)
     )
)














;TEST
(IF  (AND (= ANS1 "N") (<= LS4 20))
     (PROGN
        (COMMAND "LAYER" "SET" EJHID "")
        (COMMAND "LINE" DR1 DR2 "")
        (COMMAND "LINE" DR1 DR3 "")
        (COMMAND "LINE" DR2 DR4 "")
        (COMMAND "LINE" DR5 DR7 "")
        (COMMAND "LINE" DR6 DR8 "")
        (COMMAND "LINE" DR13 DR15 "")
        (COMMAND "LINE" DR14 DR16 "")
        (COMMAND "LINE" DR15-1 DR17 "")
        (COMMAND "LINE" DR16-1 DR18 "")
;       (COMMAND "LINE" DR11 DR17 "")
;       (COMMAND "LINE" DR12 DR18 "")
        (COMMAND "LAYER" "SET" EJCNT "")
        (COMMAND "LINE" DR15-1 DR21-1 "")
        (COMMAND "LINE" DR16-1 DR22-1 "")
        (COMMAND "LAYER" "SET" EJHID "")
        (COMMAND "LINE" DR17 DR15-1 "")
        (COMMAND "LINE" DR18 DR16-1 "")
        (COMMAND "LINE" DR21-1 DR19 "")
        (COMMAND "LINE" DR22-1 DR20 "")
        (COMMAND "LINE" DR9 DR11 "")
        (COMMAND "LINE" DR10 DR12 "")
        (COMMAND "LINE" DR11 DR12 "")
        (COMMAND "ARC" DR11 "E" DR17 "R" 6)
        (COMMAND "ARC" DR18 "E" DR12 "R" 6)
     )
)

(IF  (AND (= ANS1 "Y") (<= LS4 20))
     (PROGN
        (COMMAND "LAYER" "SET" EJCNT "")
        (COMMAND "LINE" DR1 DR2 "")
        (COMMAND "LINE" DR1 DR3 "")
        (COMMAND "LINE" DR2 DR4 "")
        (COMMAND "LINE" DR5 DR7 "")
        (COMMAND "LINE" DR6 DR8 "")
        (COMMAND "LINE" DR13 DR15 "")
        (COMMAND "LINE" DR14 DR16 "")
        (COMMAND "LINE" DR21-1 DR17 "")
        (COMMAND "LINE" DR22-1 DR18 "")
;       (COMMAND "LINE" DR23 DR25 "")
;       (COMMAND "LINE" DR24 DR26 "")
        (COMMAND "LINE" DR9 DR11 "")
        (COMMAND "LINE" DR10 DR12 "")
        (COMMAND "LINE" DR11 DR12 "")
        (COMMAND "LINE" DR17 DR19 "")
        (COMMAND "LINE" DR18 DR20 "")
        (COMMAND "ARC" DR11 "E" DR17 "R" 6)
        (COMMAND "ARC" DR18 "E" DR12 "R" 6)
     )
)






;BOX ABOVE
;(COMMAND "LAYER" "SET" EJCNT "")

(IF (= ANS1 "Y")
    (PROGN
       (COMMAND "LAYER" "SET" LA11 "")
       (COMMAND "LINE" TR1 (POLAR (POLAR P1 AG1 LST) (+ AG1 AG2) (/ BD1 2.0)) "")
       (COMMAND "LINE" TR2 (POLAR (POLAR P1 AG1 LST) (- AG1 AG2) (/ BD1 2.0)) "")
       (COMMAND "LAYER" "SET" LA21 "")
       (COMMAND "LINE" TR3 (POLAR (POLAR P1 AG1 LS3) (+ AG1 AG2) (/ D 2.0)) "")
       (COMMAND "LINE" TR4 (POLAR (POLAR P1 AG1 LS3) (- AG1 AG2) (/ D 2.0)) "")
    )
)
(IF (AND (= ANS1 "Y") (<= LS4 20))
    (PROGN
       (COMMAND "LAYER" "SET" LA11 "")
       (COMMAND "LINE" TR1 (POLAR (POLAR P1 AG1 LST) (+ AG1 AG2) (/ D 2.0)) "")
       (COMMAND "LINE" TR2 (POLAR (POLAR P1 AG1 LST) (- AG1 AG2) (/ D 2.0)) "")
       (COMMAND "LAYER" "SET" LA21 "")
       (COMMAND "LINE" TR3 (POLAR (POLAR P1 AG1 LS3) (+ AG1 AG2) (/ D 2.0)) "")
       (COMMAND "LINE" TR4 (POLAR (POLAR P1 AG1 LS3) (- AG1 AG2) (/ D 2.0)) "")
    )
)

(COMMAND "LAYER" "SET" EJCEN "")
(COMMAND "LINE" (POLAR P1 AG1 -2) (POLAR P1 AG1 (+ LSE 2)) "")
)
