本帖最后由 作者 于 2007-8-14 15:02:28 编辑
我告你,用com写的, If ent.objectname.Equals("AcDbPolyline") Then Dim objpl As IAcadLWPolyline = CType(ent, IAcadLWPolyline) Dim pt12(0 To 2) As Double : Dim pt23(0 To 2) As Double Dim obj1 As Object : Dim obj2 As Object : Dim obj3 As Object : Dim obj4 As Object Dim pt1(0 To 2) As Double : Dim pt2(0 To 2) As Double : Dim pt3(0 To 2) As Double : Dim pt4(0 To 2) As Double obj1 = objpl.Coordinate(0) obj2 = objpl.Coordinate(1) obj3 = objpl.Coordinate(2) obj4 = objpl.Coordinate(3) pt1(0) = obj1(0) : pt1(1) = obj1(1) : pt1(2) = 0 pt2(0) = obj2(0) : pt2(1) = obj2(1) : pt2(2) = 0 pt3(0) = obj3(0) : pt3(1) = obj3(1) : pt3(2) = 0 pt4(0) = obj4(0) : pt4(1) = obj4(1) : pt4(2) = 0 pt12(0) = pt(0) : pt12(1) = pt2(1) : pt12(2) = 0 pt23(0) = pt3(0) : pt23(1) = pt(1) : pt23(2) = 0 End If |