使用该方法,您可以在 3D 中创建一个矩形数组。ArrayRectangular 除了指定列数(X 方向)和行数(Y 方向)之外,还可以指定级别数(Z 方向)。 创建 3D 矩形阵列本示例创建一个圆,然后使用该圆创建一个包含四行、四列和三级圆的矩形数组。 Sub Ch8_CreateRectangularArray() ' Create the circle Dim circleObj As AcadCircle Dim center(0 To 2) As Double Dim radius As Double center(0) = 2: center(1) = 2: center(2) = 0 radius = 0.5 Set circleObj = ThisDrawing.ModelSpace. _ AddCircle(center, radius) ' Define the rectangular array Dim numberOfRows As Long Dim numberOfColumns As Long Dim numberOfLevels As Long Dim distanceBwtnRows As Double Dim distanceBwtnColumns As Double Dim distanceBwtnLevels As Double numberOfRows = 4 numberOfColumns = 4 numberOfLevels = 3 distanceBwtnRows = 1 distanceBwtnColumns = 1 distanceBwtnLevels = 4 ' Create the array of objects Dim retObj As Variant retObj = circleObj.ArrayRectangular _ (numberOfRows, numberOfColumns, _ numberOfLevels, distanceBwtnRows, _ distanceBwtnColumns, distanceBwtnLevels) ZoomAll End Sub |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-8 19:32
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.