makelovew123 发表于 2008-11-2 21:18:00

[求助] 怎样让CAD中选中的数据输出到EXCEL中???

[求助]怎样在CAD中选中数据,然后输出到EXCEL中???

makelovew123 发表于 2008-11-4 18:21:00

大侠们,帮帮忙阿!

makelovew123 发表于 2008-11-6 22:04:00

大哥,你们回个话阿

wawbt 发表于 2008-11-16 15:05:00

好象只能先选择数字,进入CAD的编辑框,然后复制,在EXCEL再粘贴.

yefeiwolaile 发表于 2008-11-18 01:36:00

<p>我这里有个程序 不过有一点瑕疵</p>

apollo1985 发表于 2008-11-18 16:05:00

<p>我这个只能提取CAD中多线段的点的坐标并且生成在Excel中!不知道可不可以帮上忙!</p>

apollo1985 发表于 2008-11-18 16:06:00

<p>我这个只能提取CAD中多线段的点的坐标并且生成在Excel中!不知道可不可以帮上忙!</p>

dbczhaoy 发表于 2009-1-14 13:21:00

<p>将点取或框选的数据(应该仅指文本吧),写到TXT文件或者数组中,再往EXCEL中输入。</p><p>给你提供个将cad文本写入TXT的参考例子:</p><p>(DEFUN c:wenb()<br/>&nbsp; <br/>&nbsp; (princ "\n文本转换程序")<br/>&nbsp; (setq scal (getvar "dimscale"))<br/>&nbsp; (setq filename "d:/wenb/wenb.txt")<br/>&nbsp; ;(initget 1)<br/>&nbsp; (setq fname (getstring&nbsp; "\n请给出结果文件名&lt;d:/wenb.txt&gt;"))<br/>&nbsp; (if (= "" fname) (setq fname filename));缺省<br/>&nbsp; (setq filename fname)<br/>&nbsp; (initget "New Add")<br/>&nbsp; (setq ma (getkword"\nN重新建立文件/&lt;A添加到结果文件&gt;:"))<br/>&nbsp; (princ (strcat "\n&nbsp; 数据写入文件" filename "中"))<br/>&nbsp; (setq row 0 g "\"" ga "\",\"")&nbsp; <br/>&nbsp; (cond&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; ((= ma "New")<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq fff (open filename "w")) <br/>&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp; ((= ma "Add")<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq fff (open filename "a"))<br/>&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp; (T<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq fff (open filename "a"))<br/>&nbsp;&nbsp;&nbsp; )<br/>&nbsp; )<br/>&nbsp; ;(setq fff (open filename "a"))&nbsp; <br/>&nbsp; (if fff<br/>&nbsp;&nbsp;&nbsp; (progn<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (initget 1)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq pbase (getpoint "\n给出框取文本基准点"))<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq xbase (car pbase))<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq ybase (cadr pbase))<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (prompt "\n框取要提取的文本")<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq sset (ssget))<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq ssl (sslength sset) nsset (ssadd))<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (while (&gt; ssl 0)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq temp (ssname sset(setq ssl (1- ssl))))<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq tj1 (= (cdr (assoc 0 (entget temp))) "TEXT"))<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (if tj1 (ssadd temp nsset))<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq wzlist (list (list "x999y999 end")))&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq nssl (sslength nsset) i 0&nbsp; rmax 1)&nbsp;&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (PRINC (STRCAT "\n "(ITOA NSSL) " 个文本已找到")) <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (princ "\n&nbsp; 正在筛选出文本...")<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (while (&lt; i nssl)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq twz t)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq temp (ssname nsset i))<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq i (1+ i))<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq wz (cdr (assoc 1 (entget temp))))<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq rline&nbsp;&nbsp; wz )&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (write-line rline fff) <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (close fff)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (princ)<br/>&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp; (princ (strcat "不能打开文件" filename)) <br/>&nbsp; )<br/>)<br/></p>

qixin0728 发表于 2009-2-20 15:36:00

回复:(apollo1985)[upload=rar]UploadFile/2008-11...

<p>有输入坐标的软件也就很高兴了。能否给个适用07CAD的。<a href="mailto:yangdl-0728@163.com">yangdl-0728@163.com</a>
        </p>

zhy307501169 发表于 2009-3-2 12:06:00

<p>我自己编了一个程序,可以将cad中的文字,标注文字,直线的长度输入到Excel里,使用方法是用鼠标点一个就进去(Excel里)一个,可是设置数据一共有多少列。</p><p>QQ:307501169</p>
页: [1] 2
查看完整版本: [求助] 怎样让CAD中选中的数据输出到EXCEL中???