ThisDrawing.ActiveTextStyle.fontFile 的用法
本帖最后由 作者 于 2008-6-24 22:35:51 编辑 <br /><br /> <p>在<a href="http://bbs.mjtd.com/forum.php?mod=viewthread&tid=859&replyID=3648&skin=1">http://bbs.mjtd.com/forum.php?mod=viewthread&tid=859&replyID=3648&skin=1</a>对ActiveTextStyle的应用要比VBA的帮助文件更容易理解.</p><p>如,ThisDrawing.ActiveTextStyle.fontFile = "c:\windows\fonts\simsun.ttf"</p><p>帮助文件就比较麻烦了.</p><pre class="Code">Sub Example_ActiveTextStyle()<br/> ' This example returns the current text style<br/> ' and then sets a new style.<br/> ' Finally, it returns the style to the previous setting.<br/> Dim newTextStyle As AcadTextStyle<br/> Dim currTextStyle As AcadTextStyle<br/> <br/> ' Return current text style of active document<br/> Set currTextStyle = ThisDrawing.ActiveTextStyle<br/> MsgBox "The current text style is " & currTextStyle.name, vbInformation, "ActiveTextStyle Example"<br/> <br/> ' Create a text style and make it current<br/> Set newTextStyle = ThisDrawing.TextStyles.Add("TestTextStyle")<br/> ThisDrawing.ActiveTextStyle = newTextStyle<br/> MsgBox "The new text style is " & newTextStyle.name, vbInformation, "ActiveTextStyle Example"<br/> <br/> ' Reset the text style to its previous setting<br/> ThisDrawing.ActiveTextStyle = currTextStyle<br/> MsgBox "The text style is reset to " & currTextStyle.name, vbInformation, "ActiveTextStyle Example"<br/>End Sub</pre><pre class="Code"> </pre><pre class="Code"> </pre> 路过,学习,谢谢兰州人
页:
[1]