<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://communities.bentley.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>How do you get the Font Name of an Enter Data Field?</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/118949/how-do-you-get-the-font-name-of-an-enter-data-field</link><description>I have a design file with 1 Enter Data field element. 
 How do you get the Font Name from this text string? 
 Thanks! 
 Regan</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How do you get the Font Name of an Enter Data Field?</title><link>https://communities.bentley.com/thread/366811?ContentTypeID=1</link><pubDate>Sat, 07 May 2016 18:57:07 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:6801cb91-1558-4e42-9f45-eb6743466aa6</guid><dc:creator>Jon Summers</dc:creator><description>&lt;p&gt;[quote user=&amp;quot;rpsmith&amp;quot;]&lt;/p&gt;
&lt;p&gt;I have a design file with 1&amp;nbsp;Enter Data field element. How do you get the Font Name from this text string?&lt;/p&gt;
&lt;p&gt;[/quote]&lt;/p&gt;
&lt;p&gt;An enter-data field is part of a &lt;span style="font-family:courier new,courier;"&gt;TextElement&lt;/span&gt;.&amp;nbsp; A&amp;nbsp;&lt;span style="font-family:courier new,courier;"&gt;TextElement&lt;/span&gt; has only one font: you can&amp;#39;t have multiple fonts in a &lt;span style="font-family:courier new,courier;"&gt;TextElement&lt;/span&gt;.&amp;nbsp; The answer to your question is: Get the font of the&amp;nbsp;&lt;span style="font-family:courier new,courier;"&gt;TextElement &lt;/span&gt;that stores the enter-data field.&lt;/p&gt;
&lt;p&gt;However, there&amp;#39;s no straightforward way to get the font of a &lt;span style="font-family:courier new,courier;"&gt;TextElement&lt;/span&gt;.&amp;nbsp; You have to get its &lt;span style="font-family:courier new,courier;"&gt;TextStyle&lt;/span&gt;, then obtain the font from the &lt;span style="font-family:courier new,courier;"&gt;TextStyle&lt;/span&gt;...&lt;/p&gt;
&lt;pre class="brush: vb; fontsize: 100; first-line: 1; "&gt;Sub GetFont (ByVal oText As TextElement)
  Dim oStyle As TextStyle
  Set oStyle = oText.TextStyle
  If Not oStyle Is Nothing Then
    Dim oFont As Font
    Set oFont = oStyle.Font
    If oFont Is Nothing Then
       Debug.Print &amp;quot;Text style &amp;#39;&amp;quot; &amp;amp; oStyle.Name &amp;amp; &amp;quot;&amp;#39; has no font&amp;quot;
    Else
       Debug.Print &amp;quot;Text style  &amp;#39;&amp;quot; &amp;amp; oStyle.Name &amp;amp; &amp;quot;&amp;#39; uses font &amp;#39;&amp;quot; &amp;amp; oFont.Name &amp;amp; &amp;quot;&amp;#39;&amp;quot;
    End If
  End If
End Sub&lt;/pre&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do you get the Font Name of an Enter Data Field?</title><link>https://communities.bentley.com/thread/366774?ContentTypeID=1</link><pubDate>Fri, 06 May 2016 19:37:04 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:17607d77-4418-4a52-8124-4fac27e0e522</guid><dc:creator>rpsmith</dc:creator><description>I&amp;#39;m using MicroStation 08.11.09.357 and using vba.&lt;br /&gt;
&lt;br /&gt;
I figured out the problem - the font actually was  invalid. If I changed the font of the enter data field, the error went away.&lt;br /&gt;
Thanks,&lt;br /&gt;
Regan&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do you get the Font Name of an Enter Data Field?</title><link>https://communities.bentley.com/thread/366769?ContentTypeID=1</link><pubDate>Fri, 06 May 2016 19:28:06 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:af15ae20-55a3-426f-aae5-ffb6c36121bd</guid><dc:creator>Jon Summers</dc:creator><description>&lt;p&gt;Please follow the &lt;a href="/products/programming/microstation_programming/f/343173/t/77384" title="MicroStation Programming forum best practices" target="_blank"&gt;MicroStation Programming forum best practices&lt;/a&gt;.&lt;/p&gt;
&lt;h4&gt;&lt;span style="color:#008000;"&gt;Identify Your Platform&lt;/span&gt;&lt;/h4&gt;
&lt;p&gt;Please identify the version of MicroStation, or other product such as PowerDraft, that you are using: MicroStation CONNECT or MicroStation V8&lt;em&gt;i&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;The APIs supplied with MicroStation&amp;nbsp;CONNECT are different to those supplied with MicroStation&amp;nbsp;V8&lt;em&gt;i&lt;/em&gt;. Consequently, our answers are likely to be different.&lt;/p&gt;
&lt;h4&gt;&lt;span style="color:#008000;"&gt;Identify Your Programming Language&lt;/span&gt;&lt;/h4&gt;
&lt;p&gt;Are you writing MDL, C++, C#, VB.NET or MicroStation VBA?&lt;/p&gt;
&lt;p&gt;Are you building an in-process app. (&lt;em&gt;&lt;a href="http://dictionary.reference.com/browse/i-e-?s=t" target="_blank"&gt;i.e.&lt;/a&gt;&lt;/em&gt;&amp;nbsp;a DLL) or a stand-alone app. (&lt;em&gt;i.e.&lt;/em&gt;&amp;nbsp;an EXE)?&lt;/p&gt;
&lt;h4&gt;&lt;span style="color:#008000;"&gt;Code Syntax Highlighting&lt;/span&gt;&lt;/h4&gt;
&lt;p&gt;When you post code, use the Forum &lt;em&gt;advanced editor&lt;/em&gt;&amp;#39;s syntax highlighting tool. That&amp;#39;s the icon that resembles a pencil:&amp;nbsp; &lt;img src="/tiny_mce/plugins/syntaxhl/img/highlight.gif" alt="Syntax Highlighter" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>