znchssy 发表于 2008-6-9 15:07:00

求助,这个“结构柱子”源程序能否按要求修改?

<p>这是它人编写的“结构柱子”的源程序,请问能否在生成结构柱子的同时沿柱子外角点生成外框线,外框线可以是line/lp线,谢谢!</p><p>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =============================================<br/>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 构造柱自动标注软件&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br/>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 版本: V1.0&nbsp;&nbsp; 作者: 尉迟俊岭&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br/>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =============================================<br/>(defun C:gzz(/ dx dy dx1 dx2 dy1 ddx ddy lay pt1 pt2 width scale)<br/>&nbsp; (setvar "CMDECHO" 0)<br/>&nbsp; (setq lay (getvar "clayer"))<br/>&nbsp; (command "color" "bylayer")<br/>&nbsp; (command "layer" "m" "gzz" "c" "m" "gzz" "")<br/>&nbsp; (setq scale (getreal "\nScale&lt;1&gt;: "))<br/>&nbsp; (cond ((= scale nil) (setq scale 100.0))<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ((= scale 1) (setq scale 100.0))<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ((= scale 100) (setq scale 1.0))<br/>&nbsp; )<br/>&nbsp; (command "osnap" "int")<br/>&nbsp; (setq pt (getpoint "\nInsert point: "))<br/>&nbsp; (command "osnap" "non")<br/>&nbsp; (setq width (getreal "\nWidth of GZZ&lt;240&gt;: "))<br/>&nbsp; (if (= width nil) (setq width 240))<br/>&nbsp; (setq width (/ width scale))<br/>&nbsp; (setq ddx (getreal "\nX-distance form insert point&lt;0&gt;: "))<br/>&nbsp; (if (= ddx nil) (setq ddx 0))<br/>&nbsp; (setq ddx (/ ddx scale))<br/>&nbsp; (setq high (getreal "\nhigh of GZZ&lt;240&gt;: "))<br/>&nbsp; (if (= high nil) (setq high 240))<br/>&nbsp; (setq high (/ high scale))<br/>&nbsp; (setq ddy (getreal "\Y-distance form insert point&lt;0&gt;: "))<br/>&nbsp; (if (= ddy nil) (setq ddy 0))<br/>&nbsp; (setq ddy (/ ddy scale))<br/>&nbsp; (setq dy (cadr pt))<br/>&nbsp; (setq dx (car pt))<br/>&nbsp; (setq dx1 (+ (- dx (/ width 2)) ddx))<br/>&nbsp; (setq dx2 (+ dx1 width))<br/>&nbsp; (setq dy1 (+ dy ddy))<br/>&nbsp; (setq pt1 (list dx1 dy1))<br/>&nbsp; (setq pt2 (list dx2 dy1))<br/>&nbsp; (command "pline" pt1 "w" high high pt2 "")&nbsp; <br/>&nbsp; (command "layer" "s" lay "")<br/>&nbsp; (princ)<br/>)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br/></p>
页: [1]
查看完整版本: 求助,这个“结构柱子”源程序能否按要求修改?