创建给定对象数、填充角度和中心点的极坐标数组。 支持的平台:仅窗口 签名工 务 局: RetVal = object.ArrayPolar(NumberOfObjects, AngleToFill, CenterPoint)
返回值(RetVal)类型:变体(对象数组) 新对象的数组。 言论AutoCAD 确定从阵列中心点到最后一个选定对象的参考点的距离。使用的参考点取决于先前选择的对象类型。AutoCAD 使用圆或圆弧的中心点、块或形状的插入点、文本的起点以及线条或轨迹的一个端点。 请注意,此方法不支持 AutoCAD 阵列命令的“复制时旋转”选项。 ![]() 极坐标阵列,对象数 = 5,填充角度 = 180,中心点 = 0,0,0。 注意:不能在循环访问集合的同时执行此方法。迭代将为只读操作打开工作空间,而此方法将尝试执行读写操作。在调用此方法之前完成任何迭代。
属性引用:不应尝试对对象使用此方法。objects 继承此方法,因为它们是图形对象之一,但是,对属性参照执行此操作是不可行的。AttributeReferenceAttributeReference 例子工 务 局: 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
Visual 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 11:58
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.