Curve.Start 属性 (Visio)

返回 Curve 对象的参数域的起始处。 此为只读属性。

语法

表达式开始

表达 一个代表 Curve 对象的变量。

返回值

Double

备注

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 支持和反馈,获取有关如何接收支持和提供反馈的指南。