ArrayPolar 方法 (ActiveX)
创建给定 NumberOfObjects、AngleToFill 和 CenterPoint 的对象的极坐标数组。 支持的平台:仅限 Windows 签名VBA: RetVal = object.ArrayPolar(NumberOfObjects, AngleToFill, CenterPoint)
返回值 (RetVal)类型:变体(对象数组) 新对象的数组。 言论AutoCAD 确定从阵列中心点到最后一个选定对象上的参考点的距离。使用的参考点取决于先前选择的对象类型。AutoCAD 使用圆或圆弧的中心点、块或形状的插入点、文本的起始点以及直线或迹线的一个端点。 请注意,此方法不支持 AutoCAD ARRAY 命令的“复制时旋转”选项。 ![]() NumberOfObjects = 5、AngleToFill = 180、CenterPoint = 0,0,0 的极坐标数组。
注意:不能在同时循环访问集合时执行此方法。迭代将为只读操作打开工作空间,而此方法将尝试执行读写操作。在调用此方法之前,请完成任何迭代。
AttributeReference:不应尝试在对象上使用此方法。 对象继承此方法,因为它们是绘图对象之一,但是,对属性参照执行此操作是不可行的。AttributeReferenceAttributeReference 例子VBA: Sub Example_ArrayPolar()
' This example creates a circle and then performs a polar array
' on that circle.
' 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 = 1
Set circleObj = ThisDrawing.ModelSpace.AddCircle(center, radius)
ZoomAll
MsgBox "Perform the polar array on the circle.", , "ArrayPolar Example"
' Define the polar array
Dim noOfObjects As Integer
Dim angleToFill As Double
Dim basePnt(0 To 2) As Double
noOfObjects = 4
angleToFill = 3.14 ' 180 degrees
basePnt(0) = 4#: basePnt(1) = 4#: basePnt(2) = 0#
' The following example will create 4 copies of an object
' by rotating and copying it about the point (3,3,0).
Dim retObj As Variant
retObj = circleObj.ArrayPolar(noOfObjects, angleToFill, basePnt)
ZoomAll
MsgBox "Polar array completed.", , "ArrayPolar Example"
End Sub
可视化 LISP: (vl-load-com)
(defun c:Example_ArrayPolar()
;; This example creates a circle and then performs a polar array
;; on that circle.
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
;; Create the circle
(setq center (vlax-3d-point 2 2 0)
radius 1)
(setq modelSpace (vla-get-ModelSpace doc))
(setq circleObj (vla-AddCircle modelSpace center radius))
(vla-ZoomAll acadObj)
(alert "Perform the polar array on the circle.")
;; Define the polar array
(setq basePnt (vlax-3d-point 3 3 0)
noOfObjects 4
angleToFill 3.14) ;; 180 degrees
;; The following example will create 4 copies of an object
;; by rotating and copying it about the point (3,3,0).
(setq retObj (vla-ArrayPolar circleObj noOfObjects angleToFill basePnt))
(vla-ZoomAll acadObj)
(alert "Polar array completed.")
)
|
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-10-29 22:44
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.