kingsky 发表于 2005-8-16 11:18:00

一个图层有上千个点,要提取他们的坐标该咋办阿??急!!

谢谢大侠帮忙阿!!

zara 发表于 2005-8-16 14:28:00

<P>具体是什么情况? 可以用程序更方便吧, 到 LISP 版去问问? </P>

yxp 发表于 2005-8-16 20:45:00

<P>如果能把DWG图形传上来就好了。</P>

CADghost 发表于 2005-8-17 10:26:00

<P>要提取倒是不难,不过</P>
<P>先说说你要他们的坐标点有什么用?</P>

CADghost 发表于 2005-8-17 11:18:00

<P>;;;给你一段代码,看看是不是你需要的</P>
<P>(defun c:write-point ()<BR>&nbsp; (princ "\n请选择需要显示的坐标点...")<BR>&nbsp; (setq ss (ssget))<BR>&nbsp; (setq num (sslength ss))<BR>&nbsp; (setq num1 0)<BR>&nbsp; (SETQ LST NIL)<BR>&nbsp; (princ "\n准备写点...")<BR>&nbsp; (repeat num<BR>&nbsp;&nbsp;&nbsp; (setq ss1 (ssname ss num1))<BR>&nbsp;&nbsp;&nbsp; (setq ss_data (entget ss1))<BR>&nbsp;&nbsp;&nbsp; (setq ss_name (cdr (assoc 0 ss_data)))<BR>&nbsp;&nbsp;&nbsp; (if&nbsp;(= ss_name "POINT")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (progn<BR>&nbsp;(setq ss_DATA1 (cdr (assoc 10 ss_data)))<BR>&nbsp;(princ "\n点坐标为:")<BR>&nbsp;(princ ss_data1)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<BR>&nbsp;&nbsp;&nbsp; )<BR>&nbsp;&nbsp;&nbsp; (Setq num1 (1+ num1))<BR>&nbsp; )<BR>&nbsp; (princ "\n完毕!")<BR>&nbsp; (princ)<BR>)</P>

kingsky 发表于 2005-8-17 15:54:00

本帖最后由 作者 于 2005-8-17 17:19:09 编辑 <br /><br /> <P>谢谢各位大侠,特别是楼上的</P>
<P>小数点后面只有一位阿,有个五六位行不行?最好不用科学计数法</P>
页: [1]
查看完整版本: 一个图层有上千个点,要提取他们的坐标该咋办阿??急!!