xjh286865 发表于 2009-7-6 23:21:00

[求助]有谁知道在EXCEL中将数据粘贴至CAD命令行时回车如何表示

<p>有谁知道在EXCEL中将数据粘贴至CAD命令行时出现的问题:</p><p><table border="0" cellspacing="0" cellpadding="0" width="457" style="WIDTH: 343pt; BORDER-COLLAPSE: collapse;"><colgroup><col width="176" style="WIDTH: 132pt; mso-width-source: userset; mso-width-alt: 5632;"></col><col width="72" style="WIDTH: 54pt;"></col><col width="209" style="WIDTH: 157pt; mso-width-source: userset; mso-width-alt: 6688;"></col></colgroup><tbody><tr height="24" style="HEIGHT: 18pt;"><td class="xl66" height="24" width="176" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: white; WIDTH: 132pt; HEIGHT: 18pt; BORDER-TOP: windowtext 0.5pt solid; BORDER-RIGHT: #ece9d8;"><font size="1" face="黑体">setvar cecolor 1</font></td><td class="xl65" width="72" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: white; WIDTH: 54pt; BORDER-TOP: windowtext 0.5pt solid; BORDER-RIGHT: windowtext 0.5pt solid;"><font size="1" face="黑体"> </font></td><td class="xl69" width="209" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: yellow; WIDTH: 157pt; BORDER-TOP: windowtext 0.5pt solid; BORDER-RIGHT: windowtext 0.5pt solid;"><font size="1" face="黑体"> </font></td></tr><tr height="26" style="HEIGHT: 20.1pt; mso-height-source: userset;"><td class="xl66" height="26" width="176" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: white; WIDTH: 132pt; HEIGHT: 20.1pt; BORDER-TOP: windowtext; BORDER-RIGHT: #ece9d8;"><font size="1" face="黑体">text j bc 0,50 10 0 IV46+750</font></td><td class="xl65" width="72" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: white; WIDTH: 54pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid;"><font size="1" face="黑体"> </font></td><td class="xl69" width="209" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: yellow; WIDTH: 157pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid;"><font size="1" face="黑体"> </font></td></tr><tr height="26" style="HEIGHT: 20.1pt; mso-height-source: userset;"><td class="xl66" height="26" width="176" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: white; WIDTH: 132pt; HEIGHT: 20.1pt; BORDER-TOP: windowtext; BORDER-RIGHT: #ece9d8;"><font size="1" face="黑体"> </font></td><td class="xl65" width="72" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: white; WIDTH: 54pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid;"><font size="1" face="黑体"> </font></td><td class="xl69" width="209" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: yellow; WIDTH: 157pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid;"><font size="1" face="黑体"> </font></td></tr><tr height="26" style="HEIGHT: 20.1pt; mso-height-source: userset;"><td class="xl66" height="26" width="176" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: white; WIDTH: 132pt; HEIGHT: 20.1pt; BORDER-TOP: windowtext; BORDER-RIGHT: #ece9d8;"><font size="1" face="黑体">text j bc 0.000,2.483 1 0 ▽97.483</font></td><td class="xl65" width="72" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: white; WIDTH: 54pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid;"><font size="1" face="黑体"> </font></td><td class="xl69" width="209" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: yellow; WIDTH: 157pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid;"><font size="1" face="黑体">text j bc 0.000,2.483 1 0 ▽97.483</font></td></tr><tr height="26" style="HEIGHT: 20.1pt; mso-height-source: userset;"><td class="xl66" height="26" width="176" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: white; WIDTH: 132pt; HEIGHT: 20.1pt; BORDER-TOP: windowtext; BORDER-RIGHT: #ece9d8;"><font size="1" face="黑体"> </font></td><td class="xl65" width="72" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: white; WIDTH: 54pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid;"><font size="1" face="黑体"> </font></td><td class="xl69" width="209" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: yellow; WIDTH: 157pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid;"><font size="1" face="黑体">text j bc -31.880,11.621 1 0 ▽106.621</font></td></tr><tr height="26" style="HEIGHT: 20.1pt; mso-height-source: userset;"><td class="xl66" height="26" width="176" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: white; WIDTH: 132pt; HEIGHT: 20.1pt; BORDER-TOP: windowtext; BORDER-RIGHT: #ece9d8;"><font size="1" face="黑体">text j bc -31.880,11.621 1 0 ▽106.621</font></td><td class="xl65" width="72" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: white; WIDTH: 54pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid;"><font size="1" face="黑体"> </font></td><td class="xl69" width="209" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: yellow; WIDTH: 157pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid;"><font size="1" face="黑体">text j bc -48.880,17.621 1 0 ▽112.621</font></td></tr><tr height="26" style="HEIGHT: 20.1pt; mso-height-source: userset;"><td class="xl66" height="26" width="176" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: white; WIDTH: 132pt; HEIGHT: 20.1pt; BORDER-TOP: windowtext; BORDER-RIGHT: #ece9d8;"><font size="1" face="黑体"> </font></td><td class="xl65" width="72" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: white; WIDTH: 54pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid;"><font size="1" face="黑体"> </font></td><td class="xl69" width="209" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: yellow; WIDTH: 157pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid;"><font size="1" face="黑体">text j bc -68.880,23.621 1 0 ▽118.621</font></td></tr><tr height="26" style="HEIGHT: 20.1pt; mso-height-source: userset;"><td class="xl66" height="26" width="176" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: white; WIDTH: 132pt; HEIGHT: 20.1pt; BORDER-TOP: windowtext; BORDER-RIGHT: #ece9d8;"><font size="1" face="黑体">text j bc -48.880,17.621 1 0 ▽112.621</font></td><td class="xl65" width="72" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: white; WIDTH: 54pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid;"><font size="1" face="黑体"> </font></td><td class="xl69" width="209" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: yellow; WIDTH: 157pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid;"><font size="1" face="黑体">text j bc -79.200,27.781 1 0 ▽122.781</font></td></tr><tr height="26" style="HEIGHT: 20.1pt; mso-height-source: userset;"><td class="xl66" height="26" width="176" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: white; WIDTH: 132pt; HEIGHT: 20.1pt; BORDER-TOP: windowtext; BORDER-RIGHT: #ece9d8;"><font size="1" face="黑体"> </font></td><td class="xl65" width="72" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: white; WIDTH: 54pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid;"><font size="1" face="黑体"> </font></td><td class="xl69" width="209" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: yellow; WIDTH: 157pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid;"><font size="1" face="黑体"> </font></td></tr><tr height="26" style="HEIGHT: 20.1pt; mso-height-source: userset;"><td class="xl66" height="26" width="176" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: white; WIDTH: 132pt; HEIGHT: 20.1pt; BORDER-TOP: windowtext; BORDER-RIGHT: #ece9d8;"><font size="1" face="黑体">text j bc -68.880,23.621 1 0 ▽118.621</font></td><td class="xl65" width="72" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: white; WIDTH: 54pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid;"><font size="1" face="黑体"> </font></td><td class="xl69" width="209" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: yellow; WIDTH: 157pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid;"><font size="1" face="黑体"> </font></td></tr><tr height="26" style="HEIGHT: 20.1pt; mso-height-source: userset;"><td class="xl66" height="26" width="176" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: white; WIDTH: 132pt; HEIGHT: 20.1pt; BORDER-TOP: windowtext; BORDER-RIGHT: #ece9d8;"><font size="1" face="黑体"> </font></td><td class="xl65" width="72" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: white; WIDTH: 54pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid;"><font size="1" face="黑体"> </font></td><td class="xl69" width="209" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: yellow; WIDTH: 157pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid;"><font size="1" face="黑体"> </font></td></tr><tr height="26" style="HEIGHT: 20.1pt; mso-height-source: userset;"><td class="xl66" height="26" width="176" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: white; WIDTH: 132pt; HEIGHT: 20.1pt; BORDER-TOP: windowtext; BORDER-RIGHT: #ece9d8;"><font size="1" face="黑体">text j bc -79.200,27.781 1 0 ▽122.781</font></td><td class="xl65" width="72" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: white; WIDTH: 54pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid;"><font size="1" face="黑体"> </font></td><td class="xl69" width="209" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: yellow; WIDTH: 157pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid;"><font size="1" face="黑体"> </font></td></tr><tr height="26" style="HEIGHT: 20.1pt; mso-height-source: userset;"><td class="xl66" height="26" width="176" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: white; WIDTH: 132pt; HEIGHT: 20.1pt; BORDER-TOP: windowtext; BORDER-RIGHT: #ece9d8;"><font size="1" face="黑体"> </font></td><td class="xl65" width="72" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: white; WIDTH: 54pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid;"><font size="1" face="黑体"> </font></td><td class="xl69" width="209" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: yellow; WIDTH: 157pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid;"><font size="1" face="黑体"> </font></td></tr><tr height="26" style="HEIGHT: 20.1pt; mso-height-source: userset;"><td class="xl66" height="26" width="176" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: white; WIDTH: 132pt; HEIGHT: 20.1pt; BORDER-TOP: windowtext; BORDER-RIGHT: #ece9d8;"><font size="1" face="黑体">text j bc -101.800,35.881 1 0 ▽130.881</font></td><td class="xl65" width="72" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: white; WIDTH: 54pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid;"><font size="1" face="黑体"> </font></td><td class="xl69" width="209" style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: yellow; WIDTH: 157pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid;"><font size="1" face="黑体"> </font></td></tr></tbody></table></p><p>见上图:白色区域复制到CAD命令行可以使用,黄色区域复制到CAD命令行时,第二行开始所有的EXCEL写好的命令在CAD中全当成第一行TEXT命令中的写入文本了,哪位高手能解决?</p>

xjh286865 发表于 2009-7-6 23:22:00

我现在所知道的是TEXT命令结束在EXCEL中作空一行的办法可以解决,有没有其他更好的方法,不用空行

qjchen 发表于 2009-7-7 09:09:00

本帖最后由 作者 于 2009-7-7 9:36:28 编辑 <br /><br /> <p>:)<br/><br/>这真是一个有趣的问题,通过查询,可以得知<br/><br/>第一列到acad里面是用了如“"text j bc 0,50 10 0 IV46+750\r\n\r\ntext j bc 0,2.483 1 0 94\r\n\r\ntext j bc 2,2.483 1 0 94\r\n\r\n"”的格式,所以可以顺利完成命令<br/><br/>而第二列是用了“"text j bc 0,50 10 0 IV46+750\r\ntext j bc 0,2.483 1 0 94\r\ntext j bc 2,2.483 1 0 94\r\n"的格式,所以就无法顺利实现。<br/><br/>所以,若能在excel里面生成如第一个字符串的格式(指的是到粘贴板中的字符串样式),就可以实现了。但是发现若在excel格子里变成”text j bc 0,50 10 0 IV46+750\r\n“的话,到了acad中,粘贴板的字符串会变成如”text j bc 0,50 10 0 IV46+750\\r\\n\r\n“的格式。<br/><br/>所以想想只好用lisp操作一下粘贴板才行,于是上网拼拼凑凑(取了VVA的粘贴板处理函数),</p><p><font face="Courier New" color="#800080" style="BACKGROUND-COLOR: #c0c0c0;"><a href="http://www.theswamp.org/index.php?topic=19805.0">http://www.theswamp.org/index.php?topic=19805.0</a></font></p><p><font face="Courier New" color="#800080" style="BACKGROUND-COLOR: #c0c0c0;">然后又查询了sendkeys的做法</font></p><p>得到这样一段代码。那么,在excel里面拷贝第二列,到ACAD中先键入test,就可以了。<br/><br/></p>

liminnet 发表于 2009-7-7 09:27:00

qjchen 发表于 2009-7-7 09:37:00

:) 刚刚查到了sendkeys的用法了。 :P

xjh286865 发表于 2009-7-7 10:08:00

<p>谢谢上面的方法,还是觉得不方便,不如我在EXCEL中空一行方便。</p><p>还有别的方法没有?要在EXCEL中复制到CAD命令行中就可以直接用的</p><p></p>

xjh286865 发表于 2009-7-7 10:19:00

<p>我做的是一个渠道断面绘制程序(用EXCEL编制的)。大家可以看看,如何解决此问题</p>

qjchen 发表于 2009-7-7 10:22:00

本帖最后由 作者 于 2009-7-7 10:59:55 编辑 <br /><br /> <p>个人觉得操作步骤差不多啊</p><p>1)空行-》做法,excel拷贝,acad粘贴</p><p>2)非空行-》做法,excel拷贝,acad中键入test&nbsp; (当然,这个要先加载一次lisp程序,大概就非楼主所愿吧)</p><p>:P,那假如楼主一定要如空行操作的话,那我觉得可能还是需要研究在excel里面如何先处理好数据的吧</p><p>EXCEL里面,可以通过</p><p>=CONCATENATE(E2,CHAR(13),CHAR(10))</p><p>这样的语句来加入\r\n的 换行符和回车符</p><p>可惜,用concatenate之后,excel拷贝会出现许多",还是导致了歧义,无法正常实现功能</p><p>当然,可能还是有很简单的方法吧:)</p><p>个人觉得,不如用lisp直接读excel,批量绘图更好,论坛上应该有这样的程序的,请搜索。</p>

xjh286865 发表于 2009-7-7 10:25:00

xjh286865 发表于 2009-7-7 10:30:00

<p>excel里面如何处理”回车“这个数据呢?要是能加上回车符就可以解决了</p><p></p>
页: [1] 2
查看完整版本: [求助]有谁知道在EXCEL中将数据粘贴至CAD命令行时回车如何表示