[VBA]菜鸟求教!高手帮忙!
菜鸟求教!高手帮忙!在CAD上画一个矩形,怎样通过编程获得矩形的信息,例如顶点坐标,四边长度等。。。
谢了! 这个你选一个多段线,用Coordinates属性返回坐标,再计算边长了 可不可以举个例子啊!这样会使我举一反三的!写几行代码给我看看行吗?谢了! Dim ent As AcadEntity<BR> Dim pnt As Variant<BR> Dim NewCoord() As Double<BR> Dim i As Integer<BR> On Error Resume Next<BR> Do<BR> ThisDrawing.Utility.GetEntity ent, pnt, "选择多线段:"<BR> If Err Then Exit Sub<BR> If TypeName(ent) Like "IAcad*Polyline" Then Exit Do<BR> Loop<BR> Dim Coord As Variant<BR> Dim CoordCount As Integer<BR>If TypeName(ent) = "IAcadLWPolyline" Then<BR> Coord = ent.Coordinates<BR> CoordCount = (UBound(Coord) + 1) / 2<BR> ReDim NewCoord(UBound(Coord)) As Double<BR> For i = 0 To UBound(Coord) - 1 Step 2<BR> NewCoord(i/2) = Coord(i)<BR> NewCoord(i/2) = Coord(i + 1)<BR> Next i<BR>end if
上面Newcoord()就是各顶点坐标 哪位高手帮我逐行解析一下上面的程序啊!求求各位高手们啦! 找本书看看了,那很多了
页:
[1]