单行文字设置textString参数值为"\U+2205直径值"
例子:- Sub Example_AddText()
- ' 该示例在模型空间中创建一个文字对象。
- Dim textObj As AcadText
- Dim textString As String
- Dim insertionPoint(0 To 2) As Double
- Dim height As Double
-
- ' 定义文字对象
- textString = "\U+220510"
- insertionPoint(0) = 2: insertionPoint(1) = 2: insertionPoint(2) = 0
- height = 0.5
-
- ' 在模型空间中创建文字对象
- Set textObj = ThisDrawing.ModelSpace.AddText(textString, insertionPoint, height)
- ZoomAll
-
- End Sub
多行文字设置text参数值为"%%c直径值"
例子:- Sub Example_AddMtext()
- ' 该示例在模型空间中创建多行文字对象。
-
- Dim MTextObj As AcadMText
- Dim corner(0 To 2) As Double
- Dim width As Double
- Dim text As String
- corner(0) = 0#: corner(1) = 10#: corner(2) = 0#
- width = 10
- text = "%%c10"
- ' 创建多行文字对象
- Set MTextObj = ThisDrawing.ModelSpace.AddMText(corner, width, text)
- ZoomAll
-
- End Sub
|