明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 4374|回复: 17

生成坐标册并绘制表格!

    [复制链接]
发表于 2004-8-26 17:02:00 | 显示全部楼层 |阅读模式
(defun c:test()
(setq key 10 i 0 j 0)
(setq obj (car (entsel "\nselect a Polyline: ")))
(setq ent (entget obj))
(setq pt(getpoint"\n坐标册放在:"))
(setq x(car pt))
(setq y(cadr pt))
(setq yn y)
(setq x4(- x 10))
(setq pt4(list x4 y))
(setq x1(+ 18 x4))
(setq pt1(list x1 y))
(setq x2(+ 46 x4))
(setq pt2(list x2 y))
(setq y9(+ y 7))
(setq pt9(list x4 y9))
(command "text" pt9 4 0 "界址点坐标册")
(command "text" pt4 4 0 "点号")
(command "text" pt1 4 0 "X坐标")
(command "text" pt2 4 0 "Y坐标")

(foreach xy ent
(if (eq (car xy) key )
(progn
(setq j (1+ j))
(setq pe1 (cdr xy))
(command "text" pe1 3 0 j)
(setq yn (- yn 10))
(setq pt3 (list x yn))
(liang pe1 pt3 j )
)
)
)
(setq x5(- x4 3.220))
(setq y5(+ y 5.2259))
(setq pt5(list x5 y5))
(setq x6(+ x5 69.1817))
(setq pt6(list x6 y5))
(command "LINE" pt5 pt6 "")
(setq a(entlast))
(command "array" a "" "r" (+ j 2) 1 -10)
(setq y7(- y5 10))
(setq pt7(list x5 y7))
(command "LINE" pt5 pt7 "")
(setq a(entlast))
(command "array" a "" "r" (+ j 1) 2 -10 11)
(setq pt8(list x6 y7))
(command "LINE" pt6 pt8 "")
(setq a(entlast))
(command "array" a "" "r" (+ j 1) 2 -10 -30)
)

(defun liang(k pt3 r)
(setq xx(car k))
(setq yy(cadr k))
(setq x1(car pt3))
(setq y1(cadr pt3))
(setq x1(+ 28 x1))
(setq pe1(list x1 y1))
(setq xj( - (car pt3) 10))
(setq pe2(list xj y1))
(command "text" pe2 3 0 r)
(command "text" pt3 3 0 (rtos xx))
(command "text" pe1 3 0 (rtos yy))
)

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
发表于 2018-8-4 11:13:32 | 显示全部楼层
过来参考参考
谢谢分享
发表于 2004-8-26 19:18:00 | 显示全部楼层
这个东东不错啊,有实用价值
发表于 2004-8-27 22:20:00 | 显示全部楼层
老兄,好象只支持一条线的两个端点呵?
发表于 2004-8-30 11:55:00 | 显示全部楼层
不正确。
发表于 2004-9-4 18:43:00 | 显示全部楼层
楼主:能否把X座标改为Y座标,Y座标改为X座标,并把表格中的XY列对调. 谢谢!
发表于 2004-9-8 00:14:00 | 显示全部楼层
坐标显示不正确,迭加在一起了。
发表于 2004-9-8 20:53:00 | 显示全部楼层
好东东.好东东.好玩,真好玩!!!!!!!!!
发表于 2004-9-8 22:26:00 | 显示全部楼层
不错,如果再能够把距离,面积标注上就全了
发表于 2004-9-9 10:11:00 | 显示全部楼层
可否一句一句的解释一下每一行,小弟想向大哥请教!!!


谢谢了!
发表于 2004-9-9 10:16:00 | 显示全部楼层
老兄


可否告知小弟,car是什么意思的?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2025-5-19 09:19 , Processed in 0.197236 second(s), 27 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表