Dim ent As AcadEntity Dim pnt As Variant Dim NewCoord() As Double Dim i As Integer On Error Resume Next Do ThisDrawing.Utility.GetEntity ent, pnt, "选择多线段:" If Err Then Exit Sub If TypeName(ent) Like "IAcad*Polyline" Then Exit Do Loop Dim Coord As Variant Dim CoordCount As Integer If TypeName(ent) = "IAcadLWPolyline" Then Coord = ent.Coordinates CoordCount = (UBound(Coord) + 1) / 2 ReDim NewCoord(UBound(Coord)) As Double For i = 0 To UBound(Coord) - 1 Step 2 NewCoord(i/2) = Coord(i) NewCoord(i/2) = Coord(i + 1) Next i end if
上面Newcoord()就是各顶点坐标
以上是求一个矩形四个顶点坐标的程序!哪位高手帮我逐行解析一下啊!谢了!