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



(defun c:DETAL3 ( / osmode_old style_name make-line make-color-line make-circle
make-axis-v make-axis-h make-wavy-v make-text make-text-l
make-arrow draw-dim-h draw-dim-h-half draw-dim-v
draw-hatch-strip c )
;| STREAMING_CHUNK:Initializing AutoCAD environment and system variables... |;
(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 geometric primitive helper functions... |;
(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)))
)
;| STREAMING_CHUNK:Defining centerline and wavy break-line generators... |;
(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-wavy-v (xbase y1 y2 / y step yn x1 x2)
(setq y y1)
(setq step 2.0)
(while (< y y2)
(setq yn (min (+ y step) y2))
(setq x1 (+ xbase (* 0.65 (sin (* y 0.22)))))
(setq x2 (+ xbase (* 0.65 (sin (* yn 0.22)))))
(make-line x1 y x2 yn 18)
(setq y yn)
)
)
;| STREAMING_CHUNK:Defining GOST text, arrow, and dimensioning 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-text-l (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)
(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-h-half (xstart x2 y2 ydim txt xtxt)
(make-line x2 y2 x2 (+ ydim (if (> ydim y2) 2.0 -2.0)) 18)
(make-line xstart ydim x2 ydim 18)
(make-arrow x2 ydim 0.0)
(make-text xtxt (+ 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)
)
)
;| STREAMING_CHUNK:Drawing the Front View with local section and hatching... |;
(make-line -50.0 0.0 50.0 0.0 50)
(make-line -50.0 0.0 -50.0 20.0 50)
(make-line 50.0 0.0 50.0 20.0 50)
(make-line -50.0 20.0 -4.5 20.0 50)
(make-line 25.0 20.0 50.0 20.0 50)
(make-line -25.0 20.0 -25.0 80.0 50)

(make-line 25.0 20.0 25.0 80.0 50)
(make-line -25.0 80.0 25.0 80.0 50)
(make-line 20.0 50.0 20.0 80.0 50)
(make-line -4.5 50.0 20.0 50.0 50)
(make-line 10.0 0.0 10.0 50.0 50)
(make-line 0.0 0.0 0.0 50.0 50)
(make-line 34.0 0.0 34.0 20.0 50)
(make-line 46.0 0.0 46.0 20.0 50)
(make-wavy-v -4.5 0.0 80.0)
(make-axis-v 0.0 -3.0 83.0)
(make-axis-v -40.0 -3.0 23.0)
(make-axis-v 40.0 -3.0 23.0)
(setq c -55.0)
(while (<= c 65.0)
(draw-hatch-strip 20.0 25.0 50.0 80.0 c)
(draw-hatch-strip 10.0 25.0 20.0 50.0 c)
(draw-hatch-strip 10.0 34.0 0.0 20.0 c)
(draw-hatch-strip 46.0 50.0 0.0 20.0 c)
(setq c (+ c 3.5))
)
;| STREAMING_CHUNK:Drawing the Top View with square pocket and rotated diamond hole... |;
(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-line -25.0 -90.0 25.0 -90.0 50)
(make-line 25.0 -90.0 25.0 -50.0 50)
(make-line 25.0 -50.0 -25.0 -50.0 50)
(make-line -25.0 -50.0 -25.0 -90.0 50)
(make-line -20.0 -85.0 20.0 -85.0 50)
(make-line 20.0 -85.0 20.0 -55.0 50)
(make-line 20.0 -55.0 -20.0 -55.0 50)
(make-line -20.0 -55.0 -20.0 -85.0 50)
(make-line 0.0 -60.0 10.0 -70.0 50)
(make-line 10.0 -70.0 0.0 -80.0 50)
(make-line 0.0 -80.0 -10.0 -70.0 50)
(make-line -10.0 -70.0 0.0 -60.0 50)
(make-circle -40.0 -70.0 6.0 50)
(make-circle 40.0 -70.0 6.0 50)
(make-axis-h -53.0 53.0 -70.0)
(make-axis-v 0.0 -103.0 -37.0)
(make-axis-v -40.0 -79.0 -61.0)
(make-axis-v 40.0 -79.0 -61.0)
;| STREAMING_CHUNK:Drawing the Left View with local section and hatching... |;
(make-line 85.0 0.0 145.0 0.0 50)
(make-line 85.0 0.0 85.0 20.0 50)
(make-line 145.0 0.0 145.0 20.0 50)
(make-line 85.0 20.0 111.0 20.0 50)
(make-line 135.0 20.0 145.0 20.0 50)
(make-line 95.0 20.0 95.0 80.0 50)
(make-line 135.0 20.0 135.0 80.0 50)
(make-line 95.0 80.0 135.0 80.0 50)
(make-line 130.0 50.0 130.0 80.0 50)
(make-line 111.0 50.0 130.0 50.0 50)
(make-line 125.0 0.0 125.0 50.0 50)
(make-line 115.0 0.0 115.0 50.0 50)
(make-wavy-v 111.0 0.0 80.0)
(make-axis-v 115.0 -3.0 83.0)
(setq c -150.0)
(while (<= c -45.0)
(draw-hatch-strip 130.0 135.0 50.0 80.0 c)
(draw-hatch-strip 125.0 135.0 20.0 50.0 c)
(draw-hatch-strip 125.0 145.0 0.0 20.0 c)
(setq c (+ c 3.5))
)
;| STREAMING_CHUNK:Adding all GOST dimensions and leaders across all three views... |;
(draw-dim-h -25.0 80.0 25.0 80.0 96.0 "50")
(draw-dim-h-half -14.0 20.0 80.0 88.0 "40" 2.0)
(draw-dim-v -50.0 0.0 -50.0 20.0 -60.0 "20")
(make-line 0.0 0.0 0.0 -13.0 18)
(draw-dim-h-half -12.0 10.0 0.0 -11.0 "20*" -4.0)
(draw-dim-h 95.0 80.0 135.0 80.0 96.0 "40")
(draw-dim-h-half 102.0 130.0 80.0 88.0 "30" 116.0)
(draw-dim-v 130.0 50.0 135.0 80.0 145.0 "30")
(draw-dim-v 145.0 0.0 135.0 80.0 156.0 "80")
(draw-dim-h 85.0 0.0 145.0 0.0 -11.0 "60")
(draw-dim-h -40.0 -70.0 40.0 -70.0 -111.0 "80")
(draw-dim-h -50.0 -100.0 50.0 -100.0 -120.0 "100")
(make-line 38.45 -75.79 45.0 -51.0 18)
(make-line 45.0 -51.0 28.0 -51.0 18)
(make-arrow 38.45 -75.79 (* pi (/ 255.0 180.0)))
(make-arrow 41.55 -64.21 (* pi (/ 75.0 180.0)))
(make-text 36.5 -49.8 "%%c12" 3.5 0.0)
(make-text 36.5 -55.2 "2 \U+043E\U+0442\U+0432." 3.5 0.0)
(make-line -10.0 -70.0 -15.3 -75.3 18)
(make-line 0.0 -80.0 -5.3 -85.3 18)
(make-line -13.89 -73.89 -3.89 -83.89 18)
(make-arrow -13.89 -73.89 (* pi 0.75))
(make-arrow -3.89 -83.89 (* pi -0.25))
(make-line -8.89 -78.89 -14.0 -95.0 18)
(make-line -14.0 -95.0 -32.0 -95.0 18)
(make-line -30.5 -93.8 -27.5 -93.8 18)
(make-line -27.5 -93.8 -27.5 -90.8 18)
(make-line -27.5 -90.8 -30.5 -90.8 18)
(make-line -30.5 -90.8 -30.5 -93.8 18)
(make-text-l -26.0 -93.8 "14,1" 3.5 0.0)
;| STREAMING_CHUNK:Restoring settings and zooming to extents... |;
(setvar "OSMODE" osmode_old)
(command "_.zoom" "_E")
(princ)
)
(c:DETAL3)