本帖最后由 作者 于 2007-11-22 17:02:33 编辑
Dim CadTxt As AcadText '文本对象 Dim TxtSty As AcadTextStyle '字体样式名 Dim TxtFont As String '字体名 Dim bold As Boolean '加粗变量名 Dim Textobj As AcadText Dim italic As Boolean '斜体变量名 Dim charset As Long '字符集变量 Dim pitchandfamily As Long '文字间距及笔画变量 Dim Dimobj As AcadDimAligned Set TxtSty = ThisDrawing.TextStyles.Add("自定义") '添加样式 TxtFont = "宋体" '设置字体 bold = True '设置字体为粗体 italic = True '设置字体为斜体 charset = 1 '默认字符集 pitchandfamily = 1 Or 16 '设定字体级数 TxtSty.SetFont TxtFont, bold, italic, charset, pitchandfamily Dim Height As Double Dim Textstring As String ThisDrawing.ActiveTextStyle = TxtSty '设定定义字体样式为当前 |