Curve.Start 屬性 (Visio)
會傳回 Curve 物件參數域的開頭。 唯讀。
語法
運算式。開始
表達 代表 Curve 物件的變數。
傳回值
雙精度浮點數
註解
Curve物件的Start屬性會傳回曲線參數定義域中起點的值。 Curve物件會以其參數定義域來描述本身,也就是範圍 [Start () ,End () ],其中 Start () 會產生曲線的起點。 請注意, Start 值不是座標組。 相反地,它代表沿著起點曲線的相對位置。 例如,如果是線條,Start的值通常是 0,End的值是 1,而且您可以使用Curve物件的Point方法來判斷曲線上任何點的座標,方法是判斷起點與端點之間的相對位置。
範例
這個 Microsoft Visual Basic for Applications (VBA) 宏會示範如何使用 Start 屬性來顯示曲線起點的值。 巨集中會使用 Point 方法來尋找曲線的中點。
Sub Start_Example()
Dim vsoShape As Visio.Shape
Dim vsoPaths As Visio.Paths
Dim vsoPath As Visio.Path
Dim vsoCurve As Visio.Curve
Dim dblStartpoint As Double
Dim dblEndpoint As Double
Dim dblX As Double
Dim dblY As Double
Dim intOuterLoopCounter As Integer
Dim intInnerLoopCounter As Integer
'Draw a shape and get its Paths collection.
Set vsoPaths = ActivePage.DrawOval(1, 1, 4, 4).Paths
'Iterate through the Path objects in the Paths collection.
For intOuterLoopCounter = 1 To vsoPaths.Count
Set vsoPath = vsoPaths.Item(intOuterLoopCounter)
Debug.Print "Path object " & intOuterLoopCounter
'Iterate through the curves in a Path object.
For intInnerLoopCounter = 1 To vsoPath.Count
Set vsoCurve = vsoPath(intInnerLoopCounter)
Debug.Print "Curve number " & intInnerLoopCounter
'Display the start point of the curve.
dblStartpoint = vsoCurve.Start
Debug.Print "Startpoint = " & dblStartpoint
'Display the endpoint of the curve.
dblEndpoint = vsoCurve.End
Debug.Print "Endpoint = " & dblEndpoint
'Find the midpoint of the curve.
vsoCurve.Point ((dblEndpoint - dblStartpoint) / 2), dblX, dblY
Debug.Print "Midpoint: x = " & dblx; ", y = " & dblY
Next intInnerLoopCounter
Debug.Print "This path has " & intInnerLoopCounter - 1 & " curve object(s)."
Next intOuterLoopCounter
Debug.Print "This shape has " & intOuterLoopCounter - 1 & " path object(s)."
End Sub
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。