马蹄型圆管接口放样
;========================================================<BR>;<BR>; 本程序适用于直斜锥台式连接钢板的实体放样.<BR>; 2000.6.8 LJC<BR>; 2000.5.30 2000.6.10<BR>;<BR>;========================================================<BR>(defun c:mt()<BR> (setq d(getreal "请输入大管直径 d=:"))<BR> (setq d1(getreal "请输入小管直径 d1=:"))<BR> (setq h(getreal "请输入直斜锥台高h=:"))<BR> (setq b1(getpoint "\n请选取放样中心: "))<BR> (command "ucsicon" "on" )<BR> (command "ucsicon" "or" ) <BR> (setq ang3 0)<BR> (command "ucs" "o" b1)<BR> (setq h0 (/ (* d h) (- d d1)) )<BR> (setq i(* pi d1))<BR> (setq i(fix i)) <BR> (setq ang(/ (/ pi 2) i))<BR> (setq ang0 0)<BR> (setq j 0)<BR> (setq l(sqrt (+(expt d 2)(expt h0 2))))<BR> (setq pt1(list l 0 0))<BR> (command "pline" pt1)<BR> <BR> (repeat i <BR> (setq J(+ j 1))<BR> (setq ang1(+ ang0 (* ang j)))<BR> (setq ang2(+ ang1 ang))<BR> (setq m(* d (cos ang1)))<BR> (setq n(* d (cos ang2)))<BR> (setq z1(+ (expt m 2) (expt n 2)))<BR> (setq z2 (cos ang ))<BR> (setq z(sqrt (- z1 (* 2(* m ( * n z2))))))<BR> (setq X(SQRT (+ (expt m 2) (expt h0 2))))<BR> (setq y(SQRT (+ (expt n 2) (expt h0 2))))<BR> (setq z3(+ (expt x 2) (expt y 2)))<BR> (setq cos0 ( /(- z3 (expt z 2)) (* 2 (* x y ))))<BR> (setq tg0 (SQRT (- (expt (/ 1 cos0) 2) 1)))<BR> (setq ang0 (atan tg0))<BR> (setq ang3(+ ang3 ang0)) <BR> (setq a(* x (cos ang3)))<BR> (setq b(* x (sin ang3)))<BR> (setq pt(list a b ))<BR> (command pt)<BR> (princ"正在生成,请稍等!! ")<BR> )<BR> (setq ptt pt)<BR> (command "")<BR>:=========================================================<BR> <BR> (setq ang0 0)<BR> (setq j 0)<BR> (setq d d1)<BR> (setq ang3 0)<BR> (setq h0(- h0 h))<BR> (setq l(sqrt (+(expt d 2)(expt h0 2))))<BR> (setq pt2(list l 0 0))<BR> (command "pline" pt2)<BR> (setq i(* pi d1))<BR> (setq i(fix i))<BR> (setq ang(/ (/ pi 2) i))<BR> (repeat i<BR> (setq J(+ j 1))<BR> (setq ang1(+ ang0 (* ang j)))<BR> (setq ang2(+ ang1 ang))<BR> (setq m(* d (cos ang1)))<BR> (setq n(* d (cos ang2)))<BR> (setq z1(+ (expt m 2) (expt n 2)))<BR> (setq z2 (cos ang ))<BR> (setq z(sqrt (- z1 (* 2(* m ( * n z2))))))<BR> (setq X(SQRT (+ (expt m 2) (expt h0 2))))<BR> (setq y(SQRT (+ (expt n 2) (expt h0 2))))<BR> (setq z3(+ (expt x 2) (expt y 2)))<BR> (setq cos0 ( /(- z3 (expt z 2)) (* 2 (* x y ))))<BR> (setq tg0 (SQRT (- (expt (/ 1 cos0) 2) 1)))<BR> (setq ang0 (atan tg0))<BR> (setq ang3(+ ang3 ang0)) <BR> (setq a(* x (cos ang3)))<BR> (setq b(* x (sin ang3)))<BR> (setq pt(list a b ))<BR> (command pt)<BR> (princ"正在生成,请稍等!! ")<BR> )<BR> (command "")<BR> (setq ptt2 pt)<BR> (command "line" ptt ptt2 "")
;==========================================================<BR> (setq dimtext0(getvar "dimtxt"))<BR> (setq dimtsz0 (getvar "dimtsz"))<BR> (setvar "dimtxt" (/ h0 8))<BR> (setvar "dimtsz" (/ h0 20))<BR>;--------------------------------------<BR> (setq qx(nth 0 ptt))<BR> (setq qx1(+ 2 qx))<BR> (setq qy(nth 1 ptt))<BR> (setq dimqy(+ h qy))<BR> (setq dimqy1(* -1 dimqy))<BR> (setq dimptt(list qx1 dimqy))<BR> (setq dimptt1(list qx1 dimqy1))<BR> (setq ptk1(list -1 -1))<BR> (COMMAND "ZOOM" DIMPTT PTK1)<BR> (setq s(ssget "c" dimptt ptk1))<BR> (command "mirror" s "" pt1 pt2 "" )<BR>;--------------------------------------<BR>(command "dimlinear" ptt2 pt1 dimptt )<BR>;--------------------------------------------------<BR>(setq qx2(nth 0 ptt2))<BR>(setq qy2(nth 1 ptt2))<BR>(setq qy3(* -1 qy2))<BR>(setq dimqx2(- qx2 (/ h 3)))<BR>(setq dimptt4(list qx2 qy3))<BR>(setq dimptt3(list dimqx2 qy2))<BR>(command "dimlinear" ptt2 dimptt4 dimptt3 )<BR>;----------------------------------------------<BR>(setq qy1(* -1 qy))<BR>(setq miptt(list qx qy1))<BR>(setq qx1(nth 0 pt1))<BR>(setq qy1(nth 1 pt1))<BR>(setq dimqx1(+ (/ h 3) qx1))<BR>(setq dimpt1(list dimqx1 qy1))<BR>(command "dimlinear" ptt miptt dimpt1 )<BR>(setq dimqx5(* 1.2 dimqx1))<BR>(setq dimptt2(list dimqx5 qy1))<BR>(setq b1 (list 0 0))<BR>(Command "dimangular" "" b1 ptt miptt dimptt2 )<BR>(Command "dimaligned" ptt2 ptt dimptt)<BR>(command "ucsicon" "off" )<BR>;--------------------------------------------------<BR>(setvar "dimtxt" dimtext0)<BR>(setvar "dimtsz" dimtsz0)<BR>(COMMAND "ZOOM" "E")
<BR>) 很好→很棒!很好~很棒!!很好……很棒!!! 看来明经做钢结构的认真的是太少了,好像大家对这个、贴子一点也不感兴趣。
回复
可能是专业性质不同吧, 不过从您的程序结构,条理足可见思维的严谨. <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">没办法我也只会些猪肉零售<FONT face="Times New Roman">, </FONT>钢结构……<SPAN style="mso-spacerun: yes"> 8-(</SPAN><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes"> </FONT><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN> 谢谢斑竹门的捧场。。 哥们和你是同行,为我们这些明经的稀有动物顶 可惜我不是搞钢结构的 经常为这样的事情烦恼
坚决支持顶 希望多发些这样的帖子。你那有那些给各种角度管子的马鞍口放样的LISP程序吗? 版主,您把 lsp 语句帖出来,大家看得很清楚,如果您再把这个 .lsp程序做个附件传上来,再写一个使用说明,这样大家都会感觉很方便的。您说呢?
每位朋友的CAD水平都不一样,所以您做 lsp 程序时最好把使用说明写详细一点,这样才能达到您那“好东西与大家分享”的初衷呀!
页:
[1]
2