梁旭武 发表于 2004-8-26 17:02:00

生成坐标册并绘制表格!




(defun c:test()<BR>       (setq key 10 i 0 j 0)<BR>       (setq obj (car (entsel "\nselect a Polyline: ")))<BR>       (setq ent (entget obj))<BR>       (setq pt(getpoint"\n坐标册放在:"))<BR>       (setq x(car pt))<BR>       (setq y(cadr pt))<BR>       (setq yn y)<BR>       (setq x4(- x 10))<BR>       (setq pt4(list x4 y))<BR>       (setq x1(+ 18 x4))<BR>       (setq pt1(list x1 y))<BR>       (setq x2(+ 46 x4))<BR>       (setq pt2(list x2 y))<BR>       (setq y9(+ y 7))<BR>       (setq pt9(list x4 y9))<BR>       (command "text" pt9 4 0 "界址点坐标册")<BR>       (command "text" pt4 4 0 "点号")<BR>       (command "text" pt1 4 0 "X坐标")<BR>       (command "text" pt2 4 0 "Y坐标")<BR>       <BR>       (foreach xy ent<BR>                       (if (eq (car xy) key )<BR>                                       (progn<BR>        (setq j (1+ j))<BR>        (setq pe1 (cdr xy))<BR>        (command "text" pe1 3 0 j)<BR>        (setq yn (- yn 10))<BR>        (setq pt3 (list x yn))<BR>        (liang pe1 pt3 j )<BR>        )<BR>                                       )<BR>                       )<BR>       (setq x5(- x4 3.220))<BR>       (setq y5(+ y 5.2259))<BR>       (setq pt5(list x5 y5))<BR>       (setq x6(+ x5 69.1817))<BR>       (setq pt6(list x6 y5))<BR>       (command "LINE" pt5 pt6 "")<BR>       (setq a(entlast))<BR>       (command "array" a "" "r" (+ j 2) 1 -10)<BR>       (setq y7(- y5 10))<BR>       (setq pt7(list x5 y7))<BR>       (command "LINE" pt5 pt7 "")<BR>       (setq a(entlast))<BR>       (command "array" a "" "r"       (+ j 1) 2 -10       11)<BR>       (setq pt8(list x6 y7))<BR>       (command "LINE" pt6 pt8 "")<BR>       (setq a(entlast))<BR>       (command "array" a "" "r"       (+ j 1) 2 -10       -30)<BR>       )<BR>       <BR>(defun liang(k pt3 r)<BR>       (setq xx(car k))<BR>       (setq yy(cadr k))<BR>       (setq x1(car pt3))<BR>       (setq y1(cadr pt3))<BR>       (setq x1(+ 28 x1))<BR>       (setq pe1(list x1 y1))<BR>       (setq xj( - (car pt3) 10))<BR>       (setq pe2(list xj y1))<BR>       (command "text" pe2 3 0 r)<BR>       (command "text" pt3 3 0 (rtos xx))<BR>       (command "text" pe1 3 0 (rtos yy))<BR>       )<BR>       <BR>

479274135 发表于 2018-8-4 11:13:32

过来参考参考
谢谢分享

wolaikk 发表于 2004-8-26 19:18:00

这个东东不错啊,有实用价值

kmjlsp 发表于 2004-8-27 22:20:00

老兄,好象只支持一条线的两个端点呵?

tangnamibe 发表于 2004-8-30 11:55:00

不正确。

diablo_xie 发表于 2004-9-4 18:43:00

楼主:能否把X座标改为Y座标,<b>Y座标改为X座标,并把表格中的XY列对调.</b>


<b>谢谢!</b>

51082481 发表于 2004-9-8 00:14:00

坐标显示不正确,迭加在一起了。

huiyin 发表于 2004-9-8 20:53:00

好东东.好东东.好玩,真好玩!!!!!!!!!

tjztsh 发表于 2004-9-8 22:26:00

不错,如果再能够把距离,面积标注上就全了

yzbj1983 发表于 2004-9-9 10:11:00

可否一句一句的解释一下每一行,小弟想向大哥请教!!!


谢谢了!

yzbj1983 发表于 2004-9-9 10:16:00

老兄


可否告知小弟,car是什么意思的?
页: [1] 2
查看完整版本: 生成坐标册并绘制表格!