|
发表于 2024-8-8 10:59:01
|
显示全部楼层
- ‘以下示例画100条平行为Y轴的直线,X方向间距为2n+1的示例代码
- Public Sub DrawLines()
- Dim i As Integer
- Dim startPoint(0 To 2) As Double
- Dim endPoint(0 To 2) As Double
- Dim spacing As Double
-
- startPoint(0) = 0
- startPoint(1) = 0
- startPoint(2) = 0
-
- For i = 0 To 99
- spacing = 2 * i + 1
- endPoint(0) = startPoint(0)
- endPoint(1) = startPoint(1) + 100 ' 假设每条直线长度为100
- endPoint(2) = startPoint(2)
-
- ThisDrawing.ModelSpace.AddLine startPoint, endPoint
-
- startPoint(0) = startPoint(0) + spacing ' 更新X坐标以实现间距
- Next i
- End Sub
复制代码 |
|