倾斜角度决定文字是向前还是向后倾斜。角度代表文字与其垂直轴(90 度)的偏移。要设置倾斜角度,请使用 ObliqueAngle 特性。倾斜角度必须是弧度,正的角度值表示向右倾斜,负值则加上 2*PI 以转换为正的等价值。
Sub Ch4_ObliqueText()
Dim textObj As AcadText
Dim textString As String
Dim insertionPoint(0 To 2) As Double
Dim height As Double
' 定义 Text 对象
textString = "Hello, World."
insertionPoint(0) = 3
insertionPoint(1) = 3
insertionPoint(2) = 0
height = 0.5
' 在模型空间中创建 Text 对象
Set textObj = ThisDrawing.ModelSpace. _
AddText(textString, insertionPoint, height)
' 将 ObliqueAngle 值改为
' 45 度(.707 弧度)
textObj.ObliqueAngle = 0.707
textObj.Update
End Sub