- '设置字型
- Function SetTtfTextStyle(TextStyleName As String, TTFName As String) As AcadTextStyle
- On Error Resume Next
- Set SetTtfTextStyle = ThisDrawing.TextStyles.Add(TextStyleName)
- SetTtfTextStyle.SetFont TTFName, False, False, 0, 0
- End Function
- ' 写文字
- Function AddTextWithStyle(TextString As String, InsertionPoint As Variant, Height As Double, Alignment As Integer, TextStyleName As String)
- Dim Text As AcadText
- Text = ThisDrawing.ModelSpace.AddText(TextString, InsertionPoint, Height)
- Text.Alignment = Alignment
- Text.TextAlignmentPoint = InsertionPoint
- Text.StyleName = TextStyleName
- End Function
|