自己业余 编了个程序,没有完成,后续都是程序的算法什么的,自己多年不用,有没有懂的朋友 ,一起完善这个。 可以加我微信,或者qq(119498366) (DEFUN C:rect (/) (command "lweight" 0.2 "");设当前对象的线宽是0.2 (setq l1 2000) ;(getint "溢洪道(mm):"))先设1000长,调试程序用,
自己业余 编了个程序,没有完成,后续都是程序的算法什么的,自己多年不用,有没有懂的朋友 ,一起完善这个。
可以加我微信,或者qq(119498366)
(DEFUN C:rect (/)
(command "lweight" 0.2 "");设当前对象的线宽是0.2
(setq l1 2000) ;(getint "溢洪道(mm):"))先设1000长,调试程序用,
(setq l2 4000) ;(getint "溢洪道陡坡段长"))
(setq l3 2000) ;(getint "溢洪道消力池段长"))
(setq h1 2000) ;(getint "溢洪道进口高"))
(setq h2 2000) ;(getint "溢洪道陡坡段高"))
(setq h3 2000) ;(getint "溢洪道消力池段高"))
(setq b 1000) ;(getint "溢洪道宽"))
(setq bili 100) ; (getint "绘图比例"))
(setq jidian (getpoint "基点:"))
;画溢流面
(setq p11 (polar jidian 0.0 l1))
(setq p12 (list (+ (car p11) l2) (- (cadr p11) h2)))
(setq p13 (polar p12 0 (- l3 500)))
(setq p14 (polar p13 (* 0.5 pi) 500))
(setq p15 (polar p14 0 500))
(setq p21 (polar jidian (* 1.5 pi) 1700))
(setq p22 (polar p21 0 500))
(setq p23 (polar p22 (* 0.5 pi) 1200))
(setq p24 (polar p23 0 (- l1 1000)))
(setq p25 (polar p24 (* 1.5 pi) 1200))
(setq p26 (polar p25 0 500))
(setq p27 (polar p26 0 500))
(setq hl (/ h2 l2 1.00));不这么做,下步计算是0,不知道呀
(setq p28 (list (+ (car p11) 500)
(- (cadr p11) (+ (sqrt (+ 250000 (* (* 500 hl) (* 500 hl)))) (* 500 hl) ))
)
)
(setq p29 (list (- (+ (car p28) l2) 1000)
(+ (- (cadr p28) (* h2 (/ (- l2 1000.00) l2))))
)
) ;此点得计算然后取交点,待定
(setq p31 (polar p12 (* 1.5 pi) 1500)) ;先求31点,好求30
(setq p30 (polar p31 pi 500))
(setq p32 (polar p31 0 500))
(setq p33 (polar p32 (* 0.5 pi) 1000))
(setq p34 (polar p33 0 (- l3 1000)))
(setq p35 (polar p34 (* 1.5 pi) 1000))
(setq p36 (polar p35 0 500))
(setq p37 (polar jidian (* 0.5 pi) h1)) ;以下各点为桥上部,
(setq P38 (polar p37 (* 0.5 pi) 500))
(setq P39 (polar p38 0 250))
(setq P40 (polar p39 (* 1.5 pi) 250))
(setq P41 (polar p40 0 (- l1 500)))
(setq p42 (polar p41 (* 0.5 pi) 250))
(setq p43 (polar p42 0 250))
(setq P44 (polar p43 (* 1.5 pi) 500))
(setq P46 (polar p15 (* 0.5 pi) (- h3 500))) ;先求,
(setq P45 (polar p46 (* 1.0 pi) l3))
(setvar "osmode" 0) ;不捕捉
(command "pline" jidian p11 p12 p13 p14 p15 "")
(command "pline" jidian p21 p22 p23 p24 p25 p26 p11 "")
(command "pline" p26 p27 p28 p29 p30 p31 p12 "")
(command "pline" p31 p32 p33 p34 p35 p36 p15 "")
(command "pline" p37 p38 p39 p40 p41 p42 p43 p44 p37 "")
(command "pline" p44 p45 p46 "") ;"w" 0.2 0.2 "")
(command "pline" jidian p37 "")
(command "pline" p11 p44 "")
(command "pline" p12 p45 "")
(command "pline" p15 p46 "")
(command "dimtxt" 250);标注文字高度2.5
(command "DIMASZ" 400);箭头大小4-5
(command "DIMDLI" 800);尺寸界线间距8
(command "DIMEXE" 300); 尺寸界线超出量3-4
(command "DIMEXO" 150);尺寸界线间隙,具体要看标注点的位置,比如,下面
(command "dimlinear" p21 jidian "v" "@-500,500");因为是竖直标注,y方向的数值没有意义
(command "dimcontinue" p37 p38 "" ""); 需要取消,然后退出两个空双引号
(command "dimlinear" p38 p39 "h" "@500,500");因为是竖直瓢,y方向的数值没有意义
(command "dimcontinue" p42 p43 p45 p46 "" "");
(command "dimlinear" p36 p15 "v" "@500,500")
(command "dimlinear" p46 p15 "v" "@500,500")
(command "dimlinear" p13 p14 "v" "@-500,500")
(command "dimlinear" p15 p14 "h" "@500,500")
(command "dimlinear" p36 p35 "h" "@500,-500");因为是竖直瓢,y方向的数值没有意义
(command "dimcontinue" p32 p31 p30 p27 p26 p25 p22 p21 "" "");
(command "dimlinear" p22 p23 "v" "@500,500")
(command "dimlinear" p25 p24 "v" "@-500,500")
(command "dimlinear" p27 p28 "v" "@500,500")
(command "dimlinear" p30 p29 "v" "@-500,500")
(command "dimlinear" p32 p33 "v" "@500,500")
(command "dimlinear" p35 p34 "v" "@-500,500")
)
(defun c:gc( )
(setq ptl (getpoint "demension piont"))
(setq cl (getstring "demension text:"))
(command "insert" "* gc" ptl "1" "0" "text" "@7,1" "3" "0" cl)
(command ""point" "@-7,-1")
)
(defun c:gcx()
(setq ptl (getstring "demension piont"))
(setq cl (getstring "demension text:"))
(command "insert" "* gcx" ptl "1" "0" "text" "@7,4" "3" "0" cl)
(command ""point" "@-7,4")
)
(defun c:pingm( )
(setq l1 1000);临时
(setq jidian2 (getpoint "jidan:"))
(command "pline" jidian2 "l" l1 "l" l2 "l" (- l3 300) "")
(command "copy" "l" "" " (0="" -300)="" ""="" "");"pline"="" (list="" (car="" jidian2)="" (-="" (cadr="" 300))="" "l"="" l1="" "");300是墙宽="" <="" />
(command ".line" "" "@0,50" ".gif'/>-100,0" p "")
)
(defun c:gj(/ jidian2)
;画断面
(setq bgj 2000);bgj宽
(setq hgj 1000 );hgj高
(setq houdbgj 500);底板厚度
(setq houqiangj 300);边墙厚度
(setq houbangj 350);桥面板厚
(setq hbaohu 50);baohu cheng hudu
(setq hpline 0.5);duo duan xian huan du
(setq rgj 5);点钢筋半径
(setq jidian2 (getpoint "jidan:"))
(command "RECTANG" jidian2 (mapcar '+ jidian2 (list bgj hgj)) "")
(setq jidian21 (mapcar '+ jidian2 (list houqiangj houdbgj)));设小矩形的基点
(command "RECTANG" jidian21 (mapcar '+ jidian21 (list (- bgj (* 2 houqiangj)) (- hgj houdbgj houbangj))) "");画小矩形
(setq jidianpl (mapcar '+ jidian2 (list hbaohu hbaohu)));第一条钢筋线的基点坐标
(command "pline" jidianpl "l" (- bgj hbaohu hbaohu) "") ;绘第一条线钢筋。
(setq jidiandian (mapcar '+ jidianpl (list rgj (+ rgj (/ hpline 2)))))
(command "-insert" "D:\\userback\\文档\\dgj.dwg" ^c "-insert" "diangj" jidianpl 1 1 0); (command "-insert" "块名" 插入点 x比例 y比例 旋转角度)
; (setq scmde (getvar “cmdecho")
;
;(setvar “cmdecho" 0)
;
;(setq f1 (getstring “\n Please input file name:"))
;
;(setq f (open f1 “r"))
;
;(print “\n Please wait ...")
;
;
;
;(setq bk “mxb1")
;
;(setq p1 (list (car p) (+ (cadr p) 8)))
;
;(while (setq a (read-line f ))
;
;(setq a (strcat “(“a ")"))
;
;(setq a (read a))
;
;(setq m1 (nth 0 a))
;
;(command “insert" bk p1 “" “" “" m1 m2 m3 m4 m5 m6 m7 m8)
;
;(setq p1 (list (car p1) (+ 8 (cadr p1))))
;
;)
;
;(setvar “comdecho" scmde)
;
;(close f)
;
;(print)
)