咕噜咕噜 发表于 2006-7-31 09:38:00

画一条曲线,可以将曲线上的各点的坐标值输出不?

<P>&nbsp;&nbsp; 我用autocad自定义坐标系,然后绘制曲线,我想将这条曲线上各点的坐标值输出成*.txt文件或用数据库形式输出,我只想得到该曲线上各点的x,y值。</P>
<P>&nbsp;&nbsp; 我将曲线制作成模块,可以输出*.txt文件,但是输出后只有一个插入点的x,y值,而且我还不晓得这个插入点是怎么来的。</P>
<P>&nbsp; 恳请各位给与指导,加急!!</P>

ynbszhy 发表于 2006-7-31 17:29:00

我想要获取坐标,只需采用List命令后,将获取的坐标信息复制,粘贴在记事体上,以*.TXT格式保存即可。

shh_188 发表于 2006-8-2 16:39:00

用id命令,然后把坐标复制到txt文本中就可以了

qoufengyu 发表于 2006-8-2 16:57:00

我上次也遇到过这样的问题,有朋友指点说,用ID可以查到,但要更精确点,还是另一位朋友说的,就是双出那条线,就会出现特性框栏,里面就在这条线的起点与终点的坐标值.你也可以试下

zxdcad 发表于 2006-8-3 23:58:00

<P>若想输出曲线上的点(不一定是控制点),有一个比较好的办法,先用定数(或定距)等分的方法作出曲线上的点,然后将这些点导出即可。</P>
<P>下面这个是我以前写的一个将点保存到文本文件中去的程序。(程序功能没有完善)</P>
<P>(defun C:POINTtofile (/ ffn ff pz ss leng index b1 tc ty xy x y z)<BR>&nbsp; (setvar "osmode" 0)<BR>&nbsp; (princ "程序功能:将点(POINT对象)的坐标写入文本文件")<BR>&nbsp; (setq ffn (getfiled "保存点(POINT对象)坐标到文本文件" "" "txt" 1))<BR>&nbsp; (setq ff (open ffn "w"))<BR>&nbsp; (setq pz (getvar "osmode"))<BR>&nbsp; (SETQ KDSS (STRCAT "\n需要将Z值写入文件吗?&lt;Y/N&gt;(N)"))<BR>&nbsp; (setq hd (strcase (getstring kdss)))<BR>&nbsp; (setq ss (ssget))<BR>&nbsp; (setq leng (sslength ss))<BR>&nbsp; (setq index 0)<BR>&nbsp; (setvar "CMDECHO" 0)<BR>&nbsp; (REPEAT leng<BR>&nbsp;&nbsp;&nbsp; (setq b1 (entget (ssname ss index)))<BR>&nbsp;&nbsp;&nbsp; (setq tc (assoc 0 b1))<BR>&nbsp;&nbsp;&nbsp; (setq ty (ssname ss index))<BR>&nbsp;&nbsp;&nbsp; (setq index (+ index 1))<BR>&nbsp;&nbsp;&nbsp; (cond<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ((= (cdr TC) "POINT")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq xy (cdr (assoc 10 b1)))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq x (car xy))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq y (cadr xy))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq z (caddr xy))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (princ x ff)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (princ " " ff)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (princ y ff)</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (if (= hd "Y")<BR>&nbsp; (progn<BR>&nbsp;&nbsp;&nbsp; (princ " " ff)<BR>&nbsp;&nbsp;&nbsp; (princ z ff)</P>
<P>&nbsp; )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (princ "\n" ff)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<BR>&nbsp;&nbsp;&nbsp; )<BR>&nbsp; )<BR>&nbsp; (princ "\n" ff)<BR>&nbsp; (close ff)<BR>&nbsp; (setvar "osmode" pz)<BR>&nbsp; (setvar "cmdecho" 1)<BR>&nbsp; (princ)<BR>)</P>

sony-lin 发表于 2006-8-4 06:54:00

<P>其实cad自带的命令 eattext 就有这个功能!!!</P>
页: [1]
查看完整版本: 画一条曲线,可以将曲线上的各点的坐标值输出不?