[求助] 怎样让CAD中选中的数据输出到EXCEL中???
[求助]怎样在CAD中选中数据,然后输出到EXCEL中??? 大侠们,帮帮忙阿! 大哥,你们回个话阿 好象只能先选择数字,进入CAD的编辑框,然后复制,在EXCEL再粘贴. <p>我这里有个程序 不过有一点瑕疵</p> <p>我这个只能提取CAD中多线段的点的坐标并且生成在Excel中!不知道可不可以帮上忙!</p> <p>我这个只能提取CAD中多线段的点的坐标并且生成在Excel中!不知道可不可以帮上忙!</p> <p>将点取或框选的数据(应该仅指文本吧),写到TXT文件或者数组中,再往EXCEL中输入。</p><p>给你提供个将cad文本写入TXT的参考例子:</p><p>(DEFUN c:wenb()<br/> <br/> (princ "\n文本转换程序")<br/> (setq scal (getvar "dimscale"))<br/> (setq filename "d:/wenb/wenb.txt")<br/> ;(initget 1)<br/> (setq fname (getstring "\n请给出结果文件名<d:/wenb.txt>"))<br/> (if (= "" fname) (setq fname filename));缺省<br/> (setq filename fname)<br/> (initget "New Add")<br/> (setq ma (getkword"\nN重新建立文件/<A添加到结果文件>:"))<br/> (princ (strcat "\n 数据写入文件" filename "中"))<br/> (setq row 0 g "\"" ga "\",\"") <br/> (cond <br/> ((= ma "New")<br/> (setq fff (open filename "w")) <br/> )<br/> ((= ma "Add")<br/> (setq fff (open filename "a"))<br/> )<br/> (T<br/> (setq fff (open filename "a"))<br/> )<br/> )<br/> ;(setq fff (open filename "a")) <br/> (if fff<br/> (progn<br/> (initget 1)<br/> (setq pbase (getpoint "\n给出框取文本基准点"))<br/> (setq xbase (car pbase))<br/> (setq ybase (cadr pbase))<br/> (prompt "\n框取要提取的文本")<br/> (setq sset (ssget))<br/> (setq ssl (sslength sset) nsset (ssadd))<br/> (while (> ssl 0)<br/> (setq temp (ssname sset(setq ssl (1- ssl))))<br/> (setq tj1 (= (cdr (assoc 0 (entget temp))) "TEXT"))<br/> (if tj1 (ssadd temp nsset))<br/> )<br/> (setq wzlist (list (list "x999y999 end"))) <br/> (setq nssl (sslength nsset) i 0 rmax 1) <br/> (PRINC (STRCAT "\n "(ITOA NSSL) " 个文本已找到")) <br/> (princ "\n 正在筛选出文本...")<br/> (while (< i nssl)<br/> (setq twz t)<br/> (setq temp (ssname nsset i))<br/> (setq i (1+ i))<br/> (setq wz (cdr (assoc 1 (entget temp))))<br/> (setq rline wz ) <br/> (write-line rline fff) <br/> ) <br/> (close fff)<br/> (princ)<br/> )<br/> (princ (strcat "不能打开文件" filename)) <br/> )<br/>)<br/></p>回复:(apollo1985)[upload=rar]UploadFile/2008-11...
<p>有输入坐标的软件也就很高兴了。能否给个适用07CAD的。<a href="mailto:yangdl-0728@163.com">yangdl-0728@163.com</a></p> <p>我自己编了一个程序,可以将cad中的文字,标注文字,直线的长度输入到Excel里,使用方法是用鼠标点一个就进去(Excel里)一个,可是设置数据一共有多少列。</p><p>QQ:307501169</p>
页:
[1]
2