Загрузка данных



(defun c:DETAL3 ( / osmode_old style_name make-line make-circle
make-axis-v make-axis-h make-dashed-v make-dashed-h
make-text make-arrow draw-dim-h draw-dim-v draw-dim-v-out )
;| STREAMING_CHUNK:Initializing AutoCAD environment and GOST text style... |;
(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")))
;| STREAMING_CHUNK:Defining line, dashed-line, and centerline generators... |;
(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-axis-v (x y1 y2 / cur yn)
(setq cur y1)
(while (< cur y2)
(setq yn (min (+ cur 12.0) y2))
(make-line x cur x yn 18)
(if (< (+ cur 14.5) y2)
(make-line x (+ cur 14.0) x (min (+ cur 15.5) y2) 18)
)
(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-line cur y xn y 18)
(if (< (+ cur 14.5) x2)
(make-line (+ cur 14.0) y (min (+ cur 15.5) x2) y 18)
)
(setq cur (+ cur 17.5))
)
)
(defun make-dashed-v (x y1 y2 / cur yn)
(setq cur y1)
(while (< cur y2)
(setq yn (min (+ cur 4.0) y2))
(make-line x cur x yn 18)
(setq cur (+ cur 6.0))
)
)
(defun make-dashed-h (x1 x2 y / cur xn)
(setq cur x1)
(while (< cur x2)
(setq xn (min (+ cur 4.0) x2))
(make-line cur y xn y 18)
(setq cur (+ cur 6.0))
)
)
;| STREAMING_CHUNK:Defining GOST dimension and arrow helper functions... |;
(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-dim-v-out (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 6.0) xdim (+ y2 6.0) 18)
(make-arrow xdim y1 (* 0.5 pi))
(make-arrow xdim y2 (* 1.5 pi))
(setq ym (* 0.5 (+ y1 y2)))
(make-text (- xdim 1.2) ym txt 3.5 (* 0.5 pi))
)
;| STREAMING_CHUNK:Drawing the Front View contour, hidden lines, and axis... |;
(make-line -40.0 0.0 40.0 0.0 50)
(make-line -40.0 0.0 -40.0 25.0 50)
(make-line -40.0 25.0 -30.0 25.0 50)
(make-line -30.0 25.0 -30.0 10.0 50)
(make-line -30.0 10.0 -20.0 10.0 50)
(make-line -20.0 10.0 -20.0 60.0 50)
(make-line -20.0 60.0 20.0 60.0 50)
(make-line 20.0 60.0 20.0 10.0 50)
(make-line 20.0 10.0 30.0 10.0 50)
(make-line 30.0 10.0 30.0 25.0 50)
(make-line 30.0 25.0 40.0 25.0 50)
(make-line 40.0 25.0 40.0 0.0 50)
(make-dashed-v -25.0 0.0 10.0)
(make-dashed-v -10.0 0.0 60.0)
(make-dashed-v 10.0 0.0 60.0)
(make-dashed-v 25.0 0.0 10.0)
(make-axis-v 0.0 -5.0 65.0)
;| STREAMING_CHUNK:Drawing the Top View with symmetric rectangular cutouts... |;
(make-line -40.0 -90.0 40.0 -90.0 50)
(make-line 40.0 -90.0 40.0 -40.0 50)
(make-line 40.0 -40.0 -40.0 -40.0 50)
(make-line -40.0 -40.0 -40.

0 -90.0 50)
(make-line -30.0 -90.0 -30.0 -40.0 50)
(make-line 30.0 -90.0 30.0 -40.0 50)
(make-line -20.0 -90.0 -20.0 -75.0 50)
(make-line -20.0 -55.0 -20.0 -40.0 50)
(make-line 20.0 -90.0 20.0 -75.0 50)
(make-line 20.0 -55.0 20.0 -40.0 50)
(make-line -25.0 -75.0 -10.0 -75.0 50)
(make-line -10.0 -75.0 -10.0 -55.0 50)
(make-line -10.0 -55.0 -25.0 -55.0 50)
(make-line -25.0 -55.0 -25.0 -75.0 50)
(make-line 10.0 -75.0 25.0 -75.0 50)
(make-line 25.0 -75.0 25.0 -55.0 50)
(make-line 25.0 -55.0 10.0 -55.0 50)
(make-line 10.0 -55.0 10.0 -75.0 50)
(make-axis-v 0.0 -95.0 -35.0)
(make-axis-h -45.0 45.0 -65.0)
;| STREAMING_CHUNK:Drawing the Left View with visible and hidden lines... |;
(make-line 75.0 0.0 125.0 0.0 50)
(make-line 125.0 0.0 125.0 60.0 50)
(make-line 125.0 60.0 75.0 60.0 50)
(make-line 75.0 60.0 75.0 0.0 50)
(make-line 75.0 25.0 125.0 25.0 50)
(make-line 90.0 25.0 90.0 60.0 50)
(make-line 110.0 25.0 110.0 60.0 50)
(make-dashed-v 90.0 0.0 25.0)
(make-dashed-v 110.0 0.0 25.0)
(make-dashed-h 75.0 125.0 10.0)
(make-axis-v 100.0 -5.0 65.0)
;| STREAMING_CHUNK:Adding all GOST dimensions across the three views... |;
(draw-dim-h -20.0 60.0 20.0 60.0 69.0 "40")
(draw-dim-h -30.0 25.0 30.0 25.0 77.0 "60")
(draw-dim-v-out -40.0 0.0 -30.0 10.0 -49.0 "10")
(draw-dim-v -40.0 0.0 -40.0 25.0 -57.0 "25")
(draw-dim-h 75.0 0.0 125.0 0.0 -10.0 "50")
(draw-dim-v 125.0 0.0 125.0 60.0 136.0 "60")
(draw-dim-v -25.0 -75.0 -25.0 -55.0 -50.0 "20")
(draw-dim-h -40.0 -90.0 -25.0 -75.0 -100.0 "15")
(draw-dim-h -25.0 -75.0 -10.0 -75.0 -100.0 "15")
(draw-dim-h -40.0 -90.0 40.0 -90.0 -109.0 "80")
;| STREAMING_CHUNK:Restoring settings and zooming to extents... |;
(setvar "OSMODE" osmode_old)
(command "_.zoom" "_E")
(princ)
)
(c:DETAL3)