指定されたインデックスで、ポリラインのふくらみを設定します。
サポートされているプラットフォーム: Windows のみ
VBA:
object.SetBulge Index, Value
タイプ: LWPolyline、Polyline
このメソッドが適用されるオブジェクト。
アクセス: 入力のみ
タイプ: 長整数型
ふくらみ値を設定する頂点のインデックス位置。最初の頂点は、インデックス 0。
アクセス: 入力のみ
タイプ: 倍精度浮動小数点数型
指定されたインデックスでの頂点のふくらみ値
戻り値はありません。
Polyline: このメソッドは、ポリラインの Type プロパティが acSimplePoly でない場合は失敗します。
ふくらみとは、ポリラインの頂点リスト内の選択された頂点と次の頂点との間の円弧の中心角の 1/4 の正接です。負のふくらみ値は、円弧上の選択された頂点から時計回りの方向に次の頂点があることを示します。ふくらみ値 0 は直線セグメント、1 は半円を示します。
VBA:
Sub Example_SetBulge()
' This example creates a lightweight polyline in model space.
' It then finds and changes the bulge for a given segment.
Dim plineObj As AcadLWPolyline
Dim points(0 To 11) As Double
' Define the 2D polyline points
points(0) = 1: points(1) = 1
points(2) = 1: points(3) = 2
points(4) = 2: points(5) = 2
points(6) = 3: points(7) = 2
points(8) = 4: points(9) = 4
points(10) = 4: points(11) = 1
' Create a lightweight Polyline object in model space
Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
ZoomAll
' Find the bulge of the third segment
Dim currentBulge As Double
currentBulge = plineObj.GetBulge(3)
MsgBox "The bulge for the third segment is " & plineObj.GetBulge(3), , "SetBulge Example"
' Change the bulge of the third segment
plineObj.SetBulge 3, -0.5
plineObj.Update
MsgBox "The bulge for the third segment is now " & plineObj.GetBulge(3), , "SetBulge Example"
End Sub
Visual LISP:
(vl-load-com)
(defun c:Example_SetBulge()
;; This example creates a lightweight polyline in model space.
;; It then finds and changes the bulge for a given segment.
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
;; Define the 2D polyline points
(setq points (vlax-make-safearray vlax-vbDouble '(0 . 11)))
(vlax-safearray-fill points '(1 1
1 2
2 2
3 2
4 4
4 1
)
)
;; Create a lightweight Polyline object in model space
(setq modelSpace (vla-get-ModelSpace doc))
(setq plineObj (vla-AddLightWeightPolyline modelSpace points))
(vla-ZoomAll acadObj)
;; Find the bulge of the third segment
(setq currentBulge (vla-GetBulge plineObj 3))
(alert (strcat "The bulge for the third segment is " (rtos (vla-GetBulge plineObj 3) 2)))
;; Change the bulge of the third segment
(vla-SetBulge plineObj 3 -0.5)
(vla-Update plineObj)
(alert (strcat "The bulge for the third segment is now " (rtos (vla-GetBulge plineObj 3) 2)))
)