组合碟形弹簧的Autolisp程序
时间:2025-07-12
时间:2025-07-12
组合碟形弹簧的Autolisp程序,开头可以VB联系,从VB中调用数据
(defun c:diehuang()
调用VB中的数据
(setq file (open "E:/CAD课程设计/diehuang.txt" "r"))
(setq d10 (atof (read-line file)))
(setq d20 (atof (read-line file)))
(setq t10 (atof (read-line file)))
(setq h10 (atof (read-line file)))
(setq h20 (atof (read-line file)))
(setq a (atof (read-line file)))
(close file)
(command "ltscale" 5 "")
(command "limits" "0,0" "297,210")
(command "zoom" "all")
(command "osnap" "off")
(command "lwdisplay" 1)
(setq d1 (* a d10))
(setq d2 (* a d20))
(setq t1 (* a t10))
(setq h1 (* a h10))
(setq h2 (* a h20))
(setq r1 (* 0.5 d1))
(setq r2 (* 0.5 d2))
;基点为中心点
(setq p0 '(148 105))
;作图点
(setq p1 (polar p0 pi r2))
(setq p2 (polar p0 0 r2))
(setq p3 (polar p1 (* 0.5 pi) h1))
(setq p4 (polar p2 (* 0.5 pi) h1))
(setq p5 (polar p0 pi r1))
(setq p6 (polar p0 0 r1))
(setq p7 (polar p1 (* 0.5 pi) h2))
(setq p8 (polar p2 (* 0.5 pi) h2))
(setq p9 (polar p5 (* 0.5 pi) (- h2 h1)))
(setq p10 (polar p6 (* 0.5 pi) (- h2 h1)))
(setq p21 (polar p7 (* 0.5 pi) (- h2 h1)))
(setq p22 (polar p8 (* 0.5 pi) (- h2 h1)))
组合碟形弹簧的Autolisp程序,开头可以VB联系,从VB中调用数据
(setq p23 (polar p9 (* 0.5 pi) (- h2 h1)))
(setq p24 (polar p10 (* 0.5 pi) (- h2 h1)))
;中心线点
(setq p15 (polar p0 (* 0.5 pi) (* 1.5 h2)))
(setq p16 (polar p0 (* -0.5 pi) h2))
(setq p17 (polar p0 pi (* 1.1 r1)))
(setq p18 (polar p0 0 (* 1.1 r1)))
;标注线点
(setq p11 (polar p0 (* -0.5 pi) (* 0.5 h2)))
(setq p12 (polar p0 (* -0.5 pi) h2))
(setq p13 (polar p4 0 (* 1.5 (- r1 r2))))
(setq p14 (polar p1 (* 0.5 pi) (* 0.5 h1)))
;剖面线点
(setq p27 (polar p5 0 (/ (- r1 r2) 2)))
(setq p28 (polar p6 pi (/ (- r1 r2) 2)))
(setq p19 (polar p27 (* 0.5 pi) (+ (* 0.5 h1) (* 0.5 t1))))
(setq p20 (polar p28 (* 0.5 pi) (+ (* 0.5 h1) (* 0.5 t1))))
(setq p25 (polar p27 (* 0.5 pi) (+ (* 0.5 h1) (* 1.8 t1))))
(setq p26 (polar p28 (* 0.5 pi) (+ (* 0.5 h1) (* 1.8 t1))))
;粗实线图层
(setq ss (getvar "clayer"))
(command "-layer" "m" "粗实线" "c" "7" "粗实线" "l" "continuous" "粗实线" "lw" "0.35" "粗实线" "")
(command "pline" p5 p3 p4 p6"")
(command "pline" p9 p7 p8 p10"")
(command "pline" p23 p21 p22 p24"")
(command "line" p5 p9"")
(command "line" p9 p23 "")
(command "line" p3 p7 "")
(command "line" p7 p21 "")
(command "line" p4 p8 "")
(command "line" p8 p22 "")
(command "line" p6 p10 "")
(command "line" p10 p24 "")
(setvar "clayer" ss)
组合碟形弹簧的Autolisp程序,开头可以VB联系,从VB中调用数据
;标注线图层
(setq ss (getvar "clayer"))
(command "-layer" "m" "细实线" "c" "2" "细实线" "l" "continuous" "细实线" "")
(command "dimlinear" p3 p4 "t" "%%c<>" p11 "")
(command "dimlinear" p5 p6 "t" "%%c<>" p16 "")
(command "dimlinear" p6 p8 p13 "")
(command "dimlinear" p1 p3 p14 "")
(setvar "clayer" ss)
;建中心线图层
(setq ss (getvar "clayer"))
(command "-layer" "m" "中心线" "c" "1" "中心线" "l" "center2" "中心线" "")
(command "line" p15 p16 "")
(command "line" p17 p18 "")
(setvar "clayer" ss)
;建剖面线图层
(setq ss (getvar "clayer"))
(command "-layer" "m" "剖面线" "c" "5" "剖面线" "l" "continuous" "剖面线" "")
(command "-bhatch" "p" "ansi31" "1" "0" p19 "")
(command "-bhatch" "p" "ansi31" "1" "0" p20 "")
(command "-bhatch" "p" "ansi31" "1" "90" p25 "")
(command "-bhatch" "p" "ansi31" "1" "90" p26 "")
(setvar "clayer" ss)
;图框层
(command "layer" "m" "sx" "on" "sx" "c" 7 "sx" "lw" 0.4 "sx" ""); (command "line" "0,0" "297,0" "")
(command "line" "297,0" "297,210" "")
(command "line" "297,210" "0,210" "")
(command "line" "0,210" "0,0" "")
;文本绘制表格层
(command "layer" …… 此处隐藏:3069字,全部文档内容请下载后查看。喜欢就下载吧 ……
上一篇:中国戏曲与西方歌剧
下一篇:“华尔街日报体”的公式