Sub gcorner() Dim FstPnt As Variant Dim SndPnt As Variant On Error Resume Next FstPnt = ThisDrawing.Utility.GetPoint(, "选取矩形第一角点:") SndPnt = ThisDrawing.Utility.GetCorner(FstPnt, "选取矩形对角点:") Call drawbox(FstPnt, SndPnt) '调用画矩形子程序 End Sub
Private Function drawbox(p1, p2) '根据对角线坐标画矩形的子程序 Dim boxp(0 To 14) As Double boxp(0) = p1(0) boxp(1) = p1(1) boxp(3) = p1(0) boxp(4) = p2(1) boxp(6) = p2(0) boxp(7) = p2(1) boxp(9) = p2(0) boxp(10) = p1(1) boxp(12) = p1(0) boxp(13) = p1(1) Call ThisDrawing.ModelSpace.AddPolyline(boxp) End Function 这是一段代码,调用drawbox函数绘制矩形,现在想调用这个多段线对象,不知道该如何获得?请教! |