タイプ指定された引数の配列を含むバリアント型を作成します。
サポートされているプラットフォーム: Windows のみ
VBA:
object.CreateTypedArray VarArr, Type, Value1, [value2, value3, ...valueN]
タイプ: Utility
このメソッドが適用されるオブジェクト。
アクセス: 出力のみ
タイプ: バリアント型
バリアント型の変数(中身は配列)。
アクセス: 入力のみ
タイプ: VbVarType 列挙型
指定するデータ型。
vbBoolean、vbInteger、vbLong、vbSingle、vbDouble。
アクセス: 入力のみ
タイプ:上記の Type パラメータに指定する型。
バリアント型に含まれる値。
戻り値はありません。
作成された VarArr は、配列をバリアント型として受けとる AutoCAD メソッドやプロパティに渡すことができます。
このメソッドは late-binding プログラミング技法を使用してのみアクセスできます。このメソッドを使用するには、Utility オブジェクトを AcadUtility としてではなく、Object (Dim myObj As Object) として定義します。
VBA:
Sub Example_CreateTypedArray()
' This example creates a spline from variant arrays created
' from doubles using the CreateTypedArray method.
' Note that this method must be late bound. This is done
' by declaring the utility object (utilObj) as Object,
' not as AcadUtility.
Dim splineObj As AcadSpline
' Even though these are arrays, they are declared as variants
Dim startTan As Variant
Dim endTan As Variant
Dim fitPoints As Variant
Dim utilObj As Object ' Late bound object
Set utilObj = ThisDrawing.Utility
' Define the spline.
utilObj.CreateTypedArray startTan, vbDouble, 0.5, 0.5, 0
utilObj.CreateTypedArray endTan, vbDouble, 0.5, 0.5, 0
utilObj.CreateTypedArray fitPoints, vbDouble, 0, 0, 0, 5, 5, 0, 10, 0, 0
' Create the spline
Set splineObj = ThisDrawing.ModelSpace.AddSpline(fitPoints, startTan, endTan)
ZoomAll
End Sub
Visual LISP:
(vl-load-com)
(defun c:Example_CreateTypedArray()
;; This example creates a spline from variant arrays created
;; from doubles using the CreateTypedArray method.
;; Note that this method must be late bound. This is done
;; by declaring the utility object (utilObj) as Object,
;; not as AcadUtility.
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
(setq utilObj (vla-get-Utility doc))
;; Define the spline.
(vla-CreateTypedArray utilObj 'startTan vlax-vbDouble 0.5 0.5 0)
(vla-CreateTypedArray utilObj 'endTan vlax-vbDouble 0.5 0.5 0)
(vla-CreateTypedArray utilObj 'fitPoints vlax-vbDouble 0 0 0 5 5 0 10 0 0)
;; Create the spline
(setq modelSpace (vla-get-ModelSpace doc))
(setq splineObj (vla-AddSpline modelSpace fitPoints startTan endTan))
(vla-ZoomAll acadObj)
)