高手帮忙写个提取cad里面 线段的各个转点坐标
<p>如图上有一条线 有20个转点 </p><p>我想得到这20个转点的坐标保存到文本文件 怎么写呢?</p><p></p> <p></p><p>Sub Test()<br/>Dim ent As AcadEntity<br/>Dim obj As Object<br/>Dim pt<br/>ThisDrawing.Utility.GetEntity obj, pt, "Select" & vbCrLf<br/>Set ent = obj<br/>DebugPrn ent<br/>End Sub</p><p></p><p><br/><font color="#6d22dd">Private Function DebugPrn(PL As AcadEntity)<br/>Dim k As Integer, i As Integer<br/>Dim p</font></p><p><font color="#6d22dd">Select Case UCase(PL.ObjectName)<br/> Case "ACDB2DPOLYLINE", "ACDB3DPOLYLINE"<br/> k = 3<br/> Case "ACDBPOLYLINE"<br/> k = 2<br/>End Select<br/>If k <> 0 Then<br/> p = PL.Coordinates<br/> For i = 0 To (UBound(p) + 1) / k - 1<br/> Debug.Print "Vertex " & i + 1, "X=" & Format(p(i * k), "0.000"), "Y=" & Format(p(i * k + 1), "0.000")<br/> Next i<br/>Else<br/> Debug.Print "不是多段线!"<br/>End If<br/>End Function</font></p><p>=============运行结果=============================</p><p>Vertex 1 X=1181.440 Y=676.518<br/>Vertex 2 X=1353.503 Y=576.104<br/>Vertex 3 X=1396.093 Y=443.353<br/>Vertex 4 X=1373.946 Y=353.151<br/>Vertex 5 X=1321.135 Y=278.266</p> <p>网盘<a href="http://ljttjl.ys168.com">http://ljttjl.ys168.com</a> 20090222目录下载多段线坐标提取程序。</p> 谢谢
页:
[1]