tnttnoy1 发表于 2008-12-19 01:42:00

求助将txt文本中的坐标读入CAD,并连成线

<p>我有一个文本,样子如下</p><p>——</p><p>5,45,22</p><p>7,44,21</p><p>——</p><p>其中5代表X坐标,45代表Y坐标,22代表Z坐标值</p><p>有没有办法把这些数据读入CAD中,然后按照点连成线?</p><p>谢谢各位了。急</p>

jingqin0472 发表于 2008-12-29 12:59:00

<p>Open DirPath1 &amp; "\XYZ.txt" For Input As #1<br/>&nbsp;&nbsp;&nbsp; Do Until EOF(1)<br/>&nbsp;&nbsp;&nbsp; Input #1, xh, xyz(1), xyz(0), xyz(2)<br/>&nbsp;&nbsp;&nbsp; If l = 1 Then<br/>&nbsp;&nbsp;&nbsp; pt1(0) = xyz(0): pt1(1) = xyz(1): pt1(2) = xyz(2)<br/>&nbsp;&nbsp;&nbsp; Else<br/>&nbsp;&nbsp;&nbsp; pt2(0) = xyz(0): pt2(1) = xyz(1): pt2(2) = xyz(2)<br/>&nbsp;&nbsp;&nbsp; Set lll = ThisDrawing.ModelSpace.AddLine(pt1, pt2)<br/>&nbsp;&nbsp;&nbsp; pt1(0) = pt2(0): pt1(1) = pt2(1): pt1(2) = pt2(2)<br/>&nbsp;&nbsp;&nbsp; End If<br/>&nbsp;&nbsp;&nbsp; l = l + 1<br/>&nbsp;&nbsp;&nbsp; Loop<br/>&nbsp;&nbsp;&nbsp; Close #1</p>

上帝卫士 发表于 2008-12-31 10:06:00

同样的苦恼,期待回复!

surveynet 发表于 2009-1-2 16:26:00

页: [1]
查看完整版本: 求助将txt文本中的坐标读入CAD,并连成线