lzj511 发表于 2006-11-10 16:36:00

[求助]怎样从图形中用鼠标获得点击点的坐标输出到一个文件中?

<FONT face=宋体 size=2>用鼠标在屏幕上连续点击,使点击点的坐标输入到一个文本文件中?怎样实现?请高手帮忙!!!小弟先谢了!</FONT>

tcsl9621 发表于 2006-11-13 22:57:00

太简单了。先将你选择的点存到一个变量中。再将这个变量输出到一个文件就好了。

gdzhou 发表于 2006-11-14 17:49:00

<P>Dim pt As Variant<BR>Dim n As Integer<BR>On Error Resume Next</P>
<P>Open "c:\coordinates.txt" For Append As #1</P>
<P>pt = ThisDrawing.Utility.GetPoint(, "指定第 " &amp; n &amp; " 个点" &amp; vbCrLf)</P>
<P>While Not IsNull(pt)</P>
<P>n = n + 1</P>
<P>Print #1, Format(pt(0), "0.000") &amp; Chr(9) &amp; Format(pt(1), "0.000")</P>
<P>pt = Null<BR>pt = ThisDrawing.Utility.GetPoint(, "指定第 " &amp; n &amp; " 个点" &amp; vbCrLf)</P>
<P>Wend</P>
<P>Close #1<BR></P>
页: [1]
查看完整版本: [求助]怎样从图形中用鼠标获得点击点的坐标输出到一个文件中?