Curve.Points 方法 (Visio)

返回一个点数组,该数组定义一个折线,该折线近似于给定容差内的 PathCurve 对象。

语法

表达式Points (TolerancexyArray () )

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

参数

名称 必需/可选 数据类型 说明
Tolerance 必需 Double 指定返回的点的数组必须接近于真实路径的程度。
xyArray () 必需 Double 返回一个交替出现 xy 值的数组,该数组指定路径或曲线笔划上的点。

返回值

Nothing

注解

使用 PathCurve 对象的 Points 方法可获取 x,y 坐标数组,该数组指定给定容差内沿路径或曲线的点。 公差和返回的 x,y 值用内部绘图单位(英寸)表示。

如果使用 Shapes 对象的 Paths 属性来获取正在查询的 PathCurve 对象,坐标值将使用父坐标系统来表示。 如果使用 Shape 对象的 PathsLocal 属性来获取 PathCurve 对象,坐标值将使用本地坐标系统来表示。

如果 Microsoft Visio 不能实现所需的公差,Visio 会使点尽可能地接近于所需的公差。 一般说来,公差越低,Visio 返回的点越多。 Visio 不接受零 (0) 公差。

返回的数组包括路径或曲线的起点和终点,即使路径或曲线已闭合。

示例

以下 Microsoft Visual Basic for Applications (VBA) 宏将一个形状放置在页面上,检索其 Paths 集合,然后使用 Path 对象的 Points 方法返回一个点数组,该数组定义一条接近于 Path 对象的折线。

 
Public Sub Points_Example() 
 
 Dim vsoShape As Visio.Shape 
 Dim adblXYPoints() As Double 
 Dim strPointsList As String 
 Dim intOuterLoopCounter As Integer 
 Dim intInnerLoopCounter As Integer 
 
 Set vsoShape = ActivePage.DrawOval(1, 1, 4, 4) 
 
 For intOuterLoopCounter = 1 To vsoShape.Paths.Count 
 
 vsoShape.Paths(intOuterLoopCounter).Points 0.1, adblXYPoints 
 For intInnerLoopCounter = LBound(adblXYPoints) To UBound(adblXYPoints) 
 strPointsList = strPointsList & adblXYPoints(intInnerLoopCounter) & Chr(10) 
 Next intInnerLoopCounter 
 
 Next intOuterLoopCounter 
 
 Debug.Print strPointsList 
 
End Sub

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。