Selection.Flip 方法 (Visio)Selection.Flip Method (Visio)

作为一个组或单独有关其旋转中心点翻转选定的形状。Flips selected shapes either as a group or individually about their pins. 返回NothingReturns Nothing.

语法Syntax

expressionexpression. Flip( _FlipDirection_ , _FlipType_ , _BlastGuards_ , _PinX_ , _PinY_ , _PinUnitsNameOrCode_ )

_表达式_一个代表Selection对象的变量。expression A variable that represents a Selection object.

参数Parameters

名称Name 必需/可选Required/Optional 数据类型Data type 说明Description
FlipDirectionFlipDirection 必需Required VisFlipDirectionVisFlipDirection 指定在其中翻转选定形状的方向。Specifies the direction in which to flip the selection. 有关可能值,请参阅"说明"。See Remarks for possible values.
FlipTypeFlipType 可选Optional VisFlipTypesVisFlipTypes 指定翻转选定内容的方式。Specifes how selection is to be flipped. 有关可能值,请参阅"说明"。See Remarks for possible values.
BlastGuardsBlastGuards 可选Optional BooleanBoolean True以覆盖任何选定形状向其应用 GUARD 函数; ShapeSheet 中的公式False保留受保护的公式不变。True to override formulas in the ShapeSheet of any of the selected shapes to which the GUARD function has been applied; False to leave guarded formulas unchanged. 默认值为 FalseThe default is False.
PinXPinX 可选Optional DoubleDouble 当_FlipType_为visFlipSelectionWithPin时,指定有关哪些所选内容时旋转中心点的 X 位置。When FlipType is visFlipSelectionWithPin , specifies the X-position of the pin about which the selection is to be flipped.
PinYPinY 可选Optional DoubleDouble 当_FlipType_为visFlipSelectionWithPin时,指定有关哪些所选内容时旋转中心点的 Y 位置。When FlipType is visFlipSelectionWithPin , specifies the Y-position of the pin about which the selection is to be flipped.
PinUnitsNameOrCodePinUnitsNameOrCode 可选Optional VariantVariant 指定要用于_PinX_和_PinY_的单位。Specifies the units to use for PinX and PinY. 有关可能值,请参阅"说明"。See Remarks for possible values. 默认值为英寸。The default is inches.

返回值Return value

NothingNothing

注解Remarks

_Flipdirection_的以下可能值在 Visio 类型库中的VisFlipDirection中声明。The following possible values for FlipDirection are declared in VisFlipDirection in the Visio type library.

常量Constant Value DescriptionDescription
visFlipHorizontalvisFlipHorizontal 11 水平翻转选定形状。Flip the selection horizontally.
visFlipVerticalvisFlipVertical 22 垂直翻转选定形状。Flip the selection vertically.

_FlipType_的以下可能值在 Visio 类型库中的VisFlipTypes中声明。The following possible values for FlipType are declared in VisFlipTypes in the Visio type library.

常量Constant Value DescriptionDescription
visFlipSelectionWithPinvisFlipSelectionWithPin 11 沿旋转中心点翻转选定形状。Flip the selection about a pin.
visFlipSelectionvisFlipSelection 00 沿中心翻转选定形状。Flip the selection about its center.
visFlipShapesvisFlipShapes 22 沿旋转中心点翻转选定的多个形状。Flip the selected shapes about their pins.

您可以指定_PinUnitsNameOrCode_为 ( VisUnitCodes 的成员) 的整数或一个 string 值,如"英寸"。You can specify PinUnitsNameOrCode as an integer (a member of VisUnitCodes) or a string value such as "inches". 如果字符串无效或单位代码不合适 (非文本),则将生成一个错误。If the string is invalid or the unit code is inappropriate (nontextual), an error is generated.

有关有效单位字符串以及对应的自动化常量(整型值)的完整列表,请参阅关于度量单位For a complete list of valid unit strings along with corresponding Automation constants (integer values), see About units of measure.

示例Example

此 Microsoft Visual Basic for Applications (VBA) 宏演示如何使用翻转方法沿水平方向翻转选定内容。This Microsoft Visual Basic for Applications (VBA) macro shows how to use the Flip method to flip a selection horizontally.

Public Sub Flip_Example() 
 
 Dim vsoShape1 As Visio.Shape 
 Dim vsoShape2 As Visio.Shape 
 
 
 Set vsoShape1 = Application.ActiveWindow.Page.DrawRectangle(1, 9, 3, 7) 
 Set vsoShape2 = Application.ActiveWindow.Page.DrawRectangle(3, 6, 5, 5) 
 
 ActiveWindow.DeselectAll 
 
 ActiveWindow.Select vsoShape1, visSelect 
 ActiveWindow.Select vsoShape2, visSelect 
 
 
 Application.ActiveWindow.Selection.Flip visFlipHorizontal, visFlipSelection, False 
 
End Sub