Загрузка данных
(defun c:DETAL3 ( / osmode_old style_name make-line make-color-line make-circle
make-dashed-v make-axis-v make-axis-h make-text make-arrow
draw-dim-h draw-dim-v draw-hatch-strip c dx_rib )
(setq osmode_old (getvar "OSMODE"))
(setvar "OSMODE" 0)
(setvar "LWDISPLAY" 1)
(if (not (tblsearch "STYLE" "GOST_ISOCPEUR"))
(entmakex '((0 . "STYLE")
(100 . "AcDbSymbolTableRecord")
(100 . "AcDbTextStyleTableRecord")
(2 . "GOST_ISOCPEUR")
(70 . 0)
(40 . 0.0)
(41 . 1.0)
(50 . 0.0)
(71 . 0)
(3 . "isocpeur.ttf")
(4 . "")))
)
(setq style_name (if (tblsearch "STYLE" "GOST_ISOCPEUR") "GOST_ISOCPEUR" (getvar "TEXTSTYLE")))
(defun make-line (x1 y1 x2 y2 lw)
(entmakex (list '(0 . "LINE")
(list 10 x1 y1 0.0)
(list 11 x2 y2 0.0)
(cons 370 lw)))
)
(defun make-color-line (x1 y1 x2 y2 lw col)
(entmakex (list '(0 . "LINE")
(list 10 x1 y1 0.0)
(list 11 x2 y2 0.0)
(cons 62 col)
(cons 370 lw)))
)
(defun make-circle (cx cy r lw)
(entmakex (list '(0 . "CIRCLE")
(list 10 cx cy 0.0)
(cons 40 r)
(cons 370 lw)))
)
(defun make-dashed-v (x y1 y2 / cur yn)
(setq cur y1)
(while (< cur y2)
(setq yn (min (+ cur 5.5) y2))
(make-line x cur x yn 18)
(setq cur (+ cur 8.0))
)
)
(defun make-axis-v (x y1 y2 / cur yn)
(setq cur y1)
(while (< cur y2)
(setq yn (min (+ cur 12.0) y2))
(make-color-line x cur x yn 18 30)
(if (< (+ cur 14.5) y2)
(make-color-line x (+ cur 14.0) x (min (+ cur 15.5) y2) 18 30)
)
(setq cur (+ cur 17.5))
)
)
(defun make-axis-h (x1 x2 y / cur xn)
(setq cur x1)
(while (< cur x2)
(setq xn (min (+ cur 12.0) x2))
(make-color-line cur y xn y 18 30)
(if (< (+ cur 14.5) x2)
(make-color-line (+ cur 14.0) y (min (+ cur 15.5) x2) y 18 30)
)
(setq cur (+ cur 17.5))
)
)
(defun make-text (x y txt hgt rot)
(entmakex (list '(0 . "TEXT")
(list 10 x y 0.0)
(cons 40 hgt)
(cons 1 txt)
(cons 50 rot)
'(51 . 0.261799)
'(72 . 1)
(list 11 x y 0.0)
(cons 7 style_name)
'(370 . 18)))
)
(defun make-arrow (x y ang / a1 a2 len)
(setq len 3.5)
(setq a1 (+ ang (* pi (/ 165.0 180.0))))
(setq a2 (- ang (* pi (/ 165.0 180.0))))
(make-line x y (+ x (* len (cos a1))) (+ y (* len (sin a1))) 18)
(make-line x y (+ x (* len (cos a2))) (+ y (* len (sin a2))) 18)
)
(defun draw-dim-h (x1 y1 x2 y2 ydim txt / xm)
(make-line x1 y1 x1 (+ ydim (if (> ydim y1) 2.0 -2.0)) 18)
(make-line x2 y2 x2 (+ ydim (if (> ydim y2) 2.0 -2.0)) 18)
(make-line x1 ydim x2 ydim 18)
(make-arrow x1 ydim pi)
(make-arrow x2 ydim 0.0)
(setq xm (* 0.5 (+ x1 x2)))
(make-text xm (+ ydim 1.2) txt 3.5 0.0)
)
(defun draw-dim-v (x1 y1 x2 y2 xdim txt / ym)
(make-line x1 y1 (+ xdim (if (> xdim x1) 2.0 -2.0)) y1 18)
(make-line x2 y2 (+ xdim (if (> xdim x2) 2.0 -2.0)) y2 18)
(make-line xdim y1 xdim y2 18)
(make-arrow xdim y1 (* 1.5 pi))
(make-arrow xdim y2 (* 0.5 pi))
(setq ym (* 0.5 (+ y1 y2)))
(make-text (- xdim 1.2) ym txt 3.5 (* 0.5 pi))
)
(defun draw-hatch-strip (xmin xmax ymin ymax c_val / xs xe)
(setq xs (max xmin (- ymin c_val)))
(setq xe (min xmax (- ymax c_val)))
(if (< xs xe)
(make-line xs (+ xs c_val) xe (+ xe c_val) 18)
)
)
(make-line -50.0 0.0 -25.0 0.0 50)
(make-line -25.0 0.0 -25.0 10.0 50)
(make-line -25.0 10.0 25.0 10.0 50)
(make-line 25.0 10.0 25.0 0.0 50)
(make-line 25.0 0.0 50.0 0.0 50)
(make-line -50.0 0.0 -50.0 25.0 50)
(make-line 50.0 0.0 50.0 25.0 50)
(make-line -50.0 25.0 0.0 25.0 50)
(make-line 20.0 25.0 50.0 25.0 50)
(make-line -20.0 25.0 -20.0 80.0 50)
(make-line 20.0 25.0 20.0 80.0 50)
(make-line -20.0 80.0 20.0 80.0 50)
(make-line 10.0 10.0 10.0 80.0 50)
(make-line -45.0 25.0 -20.0 65.0 50)
(make-line 45.0 25.0 20.0 65.0 50)
(make-axis-v 0.0 -3.0 83.0)
(setq c -55.0)
(while (<= c 75.0)
(draw-hatch-strip 10.0 20.0 10.0 80.0 c)
(draw-hatch-strip 20.0 25.0 10.0 25.0 c)
(draw-hatch-strip 25.0 50.0 0.0 25.0 c)
(setq c (+ c 3.5))
)
(make-line -50.0 -100.0 50.0 -100.0 50)
(make-line 50.0 -100.0 50.0 -40.0 50)
(make-line 50.0 -40.0 -50.0 -40.0 50)
(make-line -50.0 -40.0 -50.0 -100.0 50)
(make-circle 0.0 -70.0 20.0 50)
(make-circle 0.0 -70.0 10.0 50)
(setq dx_rib (sqrt (- 400.0 36.0)))
(make-line -45.0 -76.0 -45.0 -64.0 50)
(make-line -45.0 -64.0 (- dx_rib) -64.0 50)
(make-line -45.0 -76.0 (- dx_rib) -76.0 50)
(make-line 45.0 -76.0 45.0 -64.0 50)
(make-line dx_rib -64.0 45.0 -64.0 50)
(make-line dx_rib -76.0 45.0 -76.0 50)
(make-dashed-v -25.0 -100.0 -40.0)
(make-dashed-v 25.0 -100.0 -40.0)
(make-axis-h -24.0 24.0 -70.0)
(make-axis-v 0.0 -94.0 -46.0)
(make-line 85.0 0.0 145.0 0.0 50)
(make-line 85.0 0.0 85.0 25.0 50)
(make-line 145.0 0.0 145.0 25.0 50)
(make-line 85.0 25.0 115.0 25.0 50)
(make-line 135.0 25.0 145.0 25.0 50)
(make-line 115.0 10.0 145.0 10.0 50)
(make-line 95.0 25.0 95.0 80.0 50)
(make-line 135.0 25.0 135.0 80.0 50)
(make-line 95.0 80.0 135.0 80.0 50)
(make-line 109.0 25.0 109.0 65.0 50)
(make-line 109.0 65.0 115.0 65.0 50)
(make-line 121.0 10.0 121.0 80.0 50)
(make-axis-v 115.0 -3.0 83.0)
(setq c -140.0)
(while (<= c -35.0)
(draw-hatch-strip 121.0 135.0 10.0 80.0 c)
(draw-hatch-strip 135.0 145.0 10.0 25.0 c)
(setq c (+ c 3.5))
)
(draw-dim-h -20.0 80.0 20.0 80.0 91.0 "%%c40")
(draw-dim-v -20.0 65.0 -50.0 25.0 -62.0 "40")
(draw-dim-v -50.0 25.0 -50.0 0.0 -62.0 "25")
(draw-dim-h -25.0 0.0 25.0 0.0 -8.0 "50")
(draw-dim-v -50.0 -40.0 -50.0 -100.0 -65.0 "60")
(make-line -45.0 -64.0 -58.0 -64.0 18)
(make-line -45.0 -76.0 -58.0 -76.0 18)
(make-line -56.0 -58.0 -56.0 -82.0 18)
(make-arrow -56.0 -64.0 (* 0.5 pi))
(make-arrow -56.0 -76.0 (* 1.5 pi))
(make-text -57.2 -70.0 "12" 3.5 (* 0.5 pi))
(draw-dim-h -45.0 -76.0 45.0 -76.0 -112.0 "90")
(draw-dim-h -50.0 -100.0 50.0 -100.0 -121.0 "100")
(make-line 115.0 80.0 115.0 88.0 18)
(make-line 121.0 80.0 121.0 88.0 18)
(make-line 106.0 86.0 128.0 86.0 18)
(make-arrow 115.0 86.0 0.0)
(make-arrow 121.0 86.0 pi)
(make-text 111.0 87.2 "%%c12" 3.5 0.0)
(draw-dim-v 135.0 80.0 145.0 0.0 165.0 "80")
(make-line 145.0 10.0 157.0 10.0 18)
(make-line 145.0 0.0 157.0 0.0 18)
(make-line 155.0 16.0 155.0 -6.0 18)
(make-arrow 155.0 10.0 (* 0.5 pi))
(make-arrow 155.0 0.0 (* 1.5 pi))
(make-text 153.8 5.0 "10" 3.5 (* 0.5 pi))
(setvar "OSMODE" osmode_old)
(command "_.zoom" "_E")
(princ)
)
(c:DETAL3)