<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Having trouble Changing text font size in a drawing sketch in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/having-trouble-changing-text-font-size-in-a-drawing-sketch/m-p/9752569#M115994</link>
    <description>&lt;P&gt;Thanks again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately that is still changing the font on all sheets!!....&lt;/P&gt;</description>
    <pubDate>Thu, 17 Sep 2020 12:18:02 GMT</pubDate>
    <dc:creator>Chris.Truelove</dc:creator>
    <dc:date>2020-09-17T12:18:02Z</dc:date>
    <item>
      <title>Having trouble Changing text font size in a drawing sketch</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/having-trouble-changing-text-font-size-in-a-drawing-sketch/m-p/9752387#M115990</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am having trouble changing the font size within a sketch that is used as part of a border title.&lt;/P&gt;&lt;P&gt;I have tried a number of different ways to do this all of which usually fail with an error relating the the code that is trying to change the font size.&lt;/P&gt;&lt;P&gt;It should be noted that the code works as it should without the extra code that is trying to change the font size.&lt;/P&gt;&lt;P&gt;Below are some snippets of the code that was used to change the font size.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;----------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Public Sub Main SketchTextAdd()&lt;BR /&gt;' a reference to the drawing document.&lt;BR /&gt;' This assumes a drawing document is active.&lt;BR /&gt;Dim oDrawDoc As DrawingDocument&lt;BR /&gt;oDrawDoc = ThisApplication.ActiveDocument&lt;BR /&gt;&lt;BR /&gt;' Create a new sketch on the active sheet.&lt;BR /&gt;Dim oSketch As Inventor.Sketch&lt;BR /&gt;oSketch = oDrawDoc.ActiveSheet.Sketches.Add&lt;BR /&gt;&lt;BR /&gt;' Open the sketch for edit so the text boxes can be created.&lt;BR /&gt;' This is only required for drawing sketches, not part.&lt;BR /&gt;oSketch.Edit&lt;BR /&gt;&lt;BR /&gt;'Identify border type&lt;BR /&gt;Dim oBorder = ActiveSheet.Border&lt;BR /&gt;&lt;BR /&gt;Dim oTG As TransientGeometry&lt;BR /&gt;oTG = ThisApplication.TransientGeometry&lt;BR /&gt;&lt;BR /&gt;' Create text with simple string as input. Since this doesn't use&lt;BR /&gt;' any text overrides, it will default to the active text style.&lt;BR /&gt;&lt;BR /&gt;Dim sText As String&lt;BR /&gt;&lt;BR /&gt;sText = InputBox("Enter new Title Text", "Secondary Title ", "")&lt;BR /&gt;iProperties.Value("Custom", "Second Title "&amp;amp; ActiveSheet.Name) = sText&lt;BR /&gt;&lt;BR /&gt;Dim oTextBox As Inventor.TextBox&lt;BR /&gt;Dim oStyle As TextStyle&lt;BR /&gt;For Each oTextBox In oTextBoxes&lt;BR /&gt;oStyle = oTextBox.Style&lt;BR /&gt;oStyle.Font = "Arial"&lt;BR /&gt;oStyle.FontSize = 1&lt;BR /&gt;Next&lt;BR /&gt;If oBorder = "A3" Then&lt;BR /&gt;oTextBox = oSketch.TextBoxes.AddByRectangle(oTG.CreatePoint2d(22.7, 3.2),oTG.CreatePoint2d(35,2.4), sText)&lt;BR /&gt;Else If oBorder = "A4" Then&lt;BR /&gt;oTextBox = oSketch.TextBoxes.AddByRectangle(oTG.CreatePoint2d(10.39, 3.2),oTG.CreatePoint2d(22,2.4), sText)&lt;BR /&gt;Else If oBorder = "A4_P" Then&lt;BR /&gt;oTextBox = oSketch.TextBoxes.AddByRectangle(oTG.CreatePoint2d(11.15, 6.195), oTG.CreatePoint2d(20.25, 4), sText)&lt;BR /&gt;End If&lt;BR /&gt;oSketch.ExitEdit&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;---------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;and I have also tried the following snippet of code to try and change the font size.&lt;/P&gt;&lt;P&gt;---------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Dim oTextBox As Inventor.TextBox&lt;/P&gt;&lt;P&gt;If oBorder = "A3" Then&lt;BR /&gt;oTextBox = oSketch.TextBoxes.AddByRectangle(oTG.CreatePoint2d(22.7, 3.2),oTG.CreatePoint2d(35,2.4), sText)&lt;BR /&gt;Else If oBorder = "A4" Then&lt;BR /&gt;oTextBox = oSketch.TextBoxes.AddByRectangle(oTG.CreatePoint2d(10.39, 3.2),oTG.CreatePoint2d(22,2.4), sText)&lt;BR /&gt;Else If oBorder = "A4_P" Then&lt;BR /&gt;oTextBox.FormattedText = "&amp;lt;StyleOverride Fontsize = '0.5'&amp;gt;" &amp;amp; sText &amp;amp; "&amp;lt;/StyleOverride&amp;gt;"&lt;BR /&gt;oTextBox = oSketch.TextBoxes.AddByRectangle(oTG.CreatePoint2d(11.15, 6.195), oTG.CreatePoint2d(20.25, 4), sText)&lt;BR /&gt;End If&lt;BR /&gt;oSketch.ExitEdit&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;----------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;I hope someone can help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Sep 2020 10:49:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/having-trouble-changing-text-font-size-in-a-drawing-sketch/m-p/9752387#M115990</guid>
      <dc:creator>Chris.Truelove</dc:creator>
      <dc:date>2020-09-17T10:49:44Z</dc:date>
    </item>
    <item>
      <title>Re: Having trouble Changing text font size in a drawing sketch</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/having-trouble-changing-text-font-size-in-a-drawing-sketch/m-p/9752444#M115991</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/9488926"&gt;@Chris.Truelove&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@B4D44A73814D7FC0D950DEDFACB97081/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #ff0000;"&gt;Sub&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Main&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;' SketchTextAdd()&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;' a reference to the drawing document.&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;' This assumes a drawing document is active.&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oDrawDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;DrawingDocument&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oDrawDoc&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ActiveDocument&lt;/SPAN&gt;

&lt;SPAN style="color: #808080;"&gt;' Create a new sketch on the active sheet.&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oSketch&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Sketch&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oSketch&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oDrawDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ActiveSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Sketches&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Add&lt;/SPAN&gt;

&lt;SPAN style="color: #808080;"&gt;' Open the sketch for edit so the text boxes can be created.&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;' This is only required for drawing sketches, not part.&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oSketch&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Edit&lt;/SPAN&gt;

&lt;SPAN style="color: #808080;"&gt;'Identify border type&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oBorder&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ActiveSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;Border&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oTG&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;TransientGeometry&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oTG&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TransientGeometry&lt;/SPAN&gt;

&lt;SPAN style="color: #808080;"&gt;' Create text with simple string as input. Since this doesn't use&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;' any text overrides, it will default to the active text style.&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;sText&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;

&lt;SPAN style="color: #800000;"&gt;sText&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;InputBox&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Enter new Title Text"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Secondary Title "&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;""&lt;/SPAN&gt;)
&lt;SPAN style="color: #800080;"&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;Value&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Custom"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Second Title "&lt;/SPAN&gt;&amp;amp; &lt;SPAN style="color: #800080;"&gt;ActiveSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;Name&lt;/SPAN&gt;) = &lt;SPAN style="color: #800000;"&gt;sText&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oTextBox&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TextBox&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oBorder&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;"A3"&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oTextBox&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oSketch&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TextBoxes&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AddByRectangle&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oTG&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreatePoint2d&lt;/SPAN&gt;(22.7, 3.2),&lt;SPAN style="color: #800000;"&gt;oTG&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreatePoint2d&lt;/SPAN&gt;(35,2.4), &lt;SPAN style="color: #800000;"&gt;sText&lt;/SPAN&gt;)
&lt;SPAN style="color: #ff0000;"&gt;Else&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oBorder&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;"A4"&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oTextBox&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oSketch&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TextBoxes&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AddByRectangle&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oTG&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreatePoint2d&lt;/SPAN&gt;(10.39, 3.2),&lt;SPAN style="color: #800000;"&gt;oTG&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreatePoint2d&lt;/SPAN&gt;(22,2.4), &lt;SPAN style="color: #800000;"&gt;sText&lt;/SPAN&gt;)
&lt;SPAN style="color: #ff0000;"&gt;Else&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oBorder&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;"A4_P"&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oTextBox&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oSketch&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TextBoxes&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AddByRectangle&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oTG&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreatePoint2d&lt;/SPAN&gt;(11.15, 6.195), &lt;SPAN style="color: #800000;"&gt;oTG&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreatePoint2d&lt;/SPAN&gt;(20.25, 4), &lt;SPAN style="color: #800000;"&gt;sText&lt;/SPAN&gt;)
&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oSketch&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ExitEdit&lt;/SPAN&gt;


&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oStyle&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;TextStyle&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oTextBox&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oSketch&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TextBoxes&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oStyle&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oTextBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Style&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oStyle&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Font&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;"Arial"&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oStyle&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;FontSize&lt;/SPAN&gt; = 1
&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Sep 2020 11:18:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/having-trouble-changing-text-font-size-in-a-drawing-sketch/m-p/9752444#M115991</guid>
      <dc:creator>JhoelForshav</dc:creator>
      <dc:date>2020-09-17T11:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: Having trouble Changing text font size in a drawing sketch</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/having-trouble-changing-text-font-size-in-a-drawing-sketch/m-p/9752468#M115992</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks for the pointer,&lt;/P&gt;&lt;P&gt;This changed all of the font sizes on all sheets.&lt;/P&gt;&lt;P&gt;I only wanted to change the font size on the A4_P sheet. Sorry I didn't explain that very well.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Sep 2020 11:31:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/having-trouble-changing-text-font-size-in-a-drawing-sketch/m-p/9752468#M115992</guid>
      <dc:creator>Chris.Truelove</dc:creator>
      <dc:date>2020-09-17T11:31:45Z</dc:date>
    </item>
    <item>
      <title>Re: Having trouble Changing text font size in a drawing sketch</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/having-trouble-changing-text-font-size-in-a-drawing-sketch/m-p/9752501#M115993</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/9488926"&gt;@Chris.Truelove&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Like this then? &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@B4D44A73814D7FC0D950DEDFACB97081/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #ff0000;"&gt;Sub&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Main&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;' SketchTextAdd()&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;' a reference to the drawing document.&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;' This assumes a drawing document is active.&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oDrawDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;DrawingDocument&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oDrawDoc&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ActiveDocument&lt;/SPAN&gt;

&lt;SPAN style="color: #808080;"&gt;' Create a new sketch on the active sheet.&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oSketch&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Sketch&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oSketch&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oDrawDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ActiveSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Sketches&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Add&lt;/SPAN&gt;

&lt;SPAN style="color: #808080;"&gt;' Open the sketch for edit so the text boxes can be created.&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;' This is only required for drawing sketches, not part.&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oSketch&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Edit&lt;/SPAN&gt;

&lt;SPAN style="color: #808080;"&gt;'Identify border type&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oBorder&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ActiveSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;Border&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oTG&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;TransientGeometry&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oTG&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TransientGeometry&lt;/SPAN&gt;

&lt;SPAN style="color: #808080;"&gt;' Create text with simple string as input. Since this doesn't use&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;' any text overrides, it will default to the active text style.&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;sText&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;

&lt;SPAN style="color: #800000;"&gt;sText&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;InputBox&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Enter new Title Text"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Secondary Title "&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;""&lt;/SPAN&gt;)
&lt;SPAN style="color: #800080;"&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;Value&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Custom"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Second Title "&lt;/SPAN&gt;&amp;amp; &lt;SPAN style="color: #800080;"&gt;ActiveSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;Name&lt;/SPAN&gt;) = &lt;SPAN style="color: #800000;"&gt;sText&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oTextBox&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TextBox&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oBorder&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;"A3"&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oTextBox&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oSketch&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TextBoxes&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AddByRectangle&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oTG&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreatePoint2d&lt;/SPAN&gt;(22.7, 3.2),&lt;SPAN style="color: #800000;"&gt;oTG&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreatePoint2d&lt;/SPAN&gt;(35,2.4), &lt;SPAN style="color: #800000;"&gt;sText&lt;/SPAN&gt;)
&lt;SPAN style="color: #ff0000;"&gt;Else&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oBorder&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;"A4"&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oTextBox&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oSketch&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TextBoxes&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AddByRectangle&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oTG&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreatePoint2d&lt;/SPAN&gt;(10.39, 3.2),&lt;SPAN style="color: #800000;"&gt;oTG&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreatePoint2d&lt;/SPAN&gt;(22,2.4), &lt;SPAN style="color: #800000;"&gt;sText&lt;/SPAN&gt;)
&lt;SPAN style="color: #ff0000;"&gt;Else&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oBorder&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;"A4_P"&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oTextBox&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oSketch&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TextBoxes&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AddByRectangle&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oTG&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreatePoint2d&lt;/SPAN&gt;(11.15, 6.195), &lt;SPAN style="color: #800000;"&gt;oTG&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreatePoint2d&lt;/SPAN&gt;(20.25, 4), &lt;SPAN style="color: #800000;"&gt;sText&lt;/SPAN&gt;)
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oStyle&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;TextStyle&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oTextBox&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Style&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oStyle&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Font&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;"Arial"&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oStyle&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;FontSize&lt;/SPAN&gt; = 1
&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oSketch&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ExitEdit&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Sub&lt;/SPAN&gt;
&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Sep 2020 11:43:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/having-trouble-changing-text-font-size-in-a-drawing-sketch/m-p/9752501#M115993</guid>
      <dc:creator>JhoelForshav</dc:creator>
      <dc:date>2020-09-17T11:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: Having trouble Changing text font size in a drawing sketch</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/having-trouble-changing-text-font-size-in-a-drawing-sketch/m-p/9752569#M115994</link>
      <description>&lt;P&gt;Thanks again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately that is still changing the font on all sheets!!....&lt;/P&gt;</description>
      <pubDate>Thu, 17 Sep 2020 12:18:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/having-trouble-changing-text-font-size-in-a-drawing-sketch/m-p/9752569#M115994</guid>
      <dc:creator>Chris.Truelove</dc:creator>
      <dc:date>2020-09-17T12:18:02Z</dc:date>
    </item>
    <item>
      <title>Re: Having trouble Changing text font size in a drawing sketch</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/having-trouble-changing-text-font-size-in-a-drawing-sketch/m-p/9752600#M115995</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/9488926"&gt;@Chris.Truelove&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You are right... We are actually changing the actual style that the textbox is using. So every other textbox using this style will be updated aswell... I guess we'll have to create a new style. Try this &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@B4D44A73814D7FC0D950DEDFACB97081/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #ff0000;"&gt;Sub&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Main&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;' SketchTextAdd()&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;' a reference to the drawing document.&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;' This assumes a drawing document is active.&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oDrawDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;DrawingDocument&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oDrawDoc&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ActiveDocument&lt;/SPAN&gt;

&lt;SPAN style="color: #808080;"&gt;' Create a new sketch on the active sheet.&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oSketch&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Sketch&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oSketch&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oDrawDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ActiveSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Sketches&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Add&lt;/SPAN&gt;

&lt;SPAN style="color: #808080;"&gt;' Open the sketch for edit so the text boxes can be created.&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;' This is only required for drawing sketches, not part.&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oSketch&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Edit&lt;/SPAN&gt;


&lt;SPAN style="color: #808080;"&gt;'Identify border type&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oBorder&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ActiveSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;Border&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oTG&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;TransientGeometry&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oTG&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TransientGeometry&lt;/SPAN&gt;

&lt;SPAN style="color: #808080;"&gt;' Create text with simple string as input. Since this doesn't use&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;' any text overrides, it will default to the active text style.&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;sText&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;

&lt;SPAN style="color: #800000;"&gt;sText&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;InputBox&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Enter new Title Text"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Secondary Title "&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;""&lt;/SPAN&gt;)
&lt;SPAN style="color: #800080;"&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;Value&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Custom"&lt;/SPAN&gt;, &lt;SPAN style="color: #008080;"&gt;"Second Title "&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #800080;"&gt;ActiveSheet&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;Name&lt;/SPAN&gt;) = &lt;SPAN style="color: #800000;"&gt;sText&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oStyle&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;TextStyle&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oDrawDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;StylesManager&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ActiveStandardStyle&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ActiveObjectDefaults&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;SketchTextStyle&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oTextBox&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TextBox&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oBorder&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;"A3"&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oTextBox&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oSketch&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TextBoxes&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AddByRectangle&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oTG&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreatePoint2d&lt;/SPAN&gt;(22.7, 3.2), &lt;SPAN style="color: #800000;"&gt;oTG&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreatePoint2d&lt;/SPAN&gt;(35, 2.4), &lt;SPAN style="color: #800000;"&gt;sText&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oStyle&lt;/SPAN&gt;)
&lt;SPAN style="color: #ff0000;"&gt;Else&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oBorder&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;"A4"&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oTextBox&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oSketch&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TextBoxes&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AddByRectangle&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oTG&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreatePoint2d&lt;/SPAN&gt;(10.39, 3.2), &lt;SPAN style="color: #800000;"&gt;oTG&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreatePoint2d&lt;/SPAN&gt;(22, 2.4), &lt;SPAN style="color: #800000;"&gt;sText&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oStyle&lt;/SPAN&gt;)
&lt;SPAN style="color: #ff0000;"&gt;Else&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oBorder&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;"A4_P"&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;A4_P_Style&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;TextStyle&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Try&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;A4_P_Style&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oDrawDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;StylesManager&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TextStyles&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"A4_P_Style"&lt;/SPAN&gt;)
&lt;SPAN style="color: #ff0000;"&gt;Catch&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;A4_P_Style&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oStyle&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Copy&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"A4_P_Style"&lt;/SPAN&gt;)
&lt;SPAN style="color: #800000;"&gt;A4_P_Style&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Font&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;"Arial"&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;A4_P_Style&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;FontSize&lt;/SPAN&gt; = 1
&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Try&lt;/SPAN&gt;

&lt;SPAN style="color: #800000;"&gt;oTextBox&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oSketch&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TextBoxes&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AddByRectangle&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oTG&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreatePoint2d&lt;/SPAN&gt;(11.15, 6.195), &lt;SPAN style="color: #800000;"&gt;oTG&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreatePoint2d&lt;/SPAN&gt;(20.25, 4), &lt;SPAN style="color: #800000;"&gt;sText&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;A4_P_Style&lt;/SPAN&gt;)

&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;oSketch&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ExitEdit&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Sub&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Sep 2020 12:31:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/having-trouble-changing-text-font-size-in-a-drawing-sketch/m-p/9752600#M115995</guid>
      <dc:creator>JhoelForshav</dc:creator>
      <dc:date>2020-09-17T12:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: Having trouble Changing text font size in a drawing sketch</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/having-trouble-changing-text-font-size-in-a-drawing-sketch/m-p/9752740#M115997</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We are getting there,&lt;/P&gt;&lt;P&gt;The Font type and size for that particular border definition is now entering in a different size and font to the rest of the sheets in the drawing. Unfortunately I cannot control the size of the text or the font used. Editing the lines&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Style&lt;/SPAN&gt;.&lt;SPAN&gt;Font&lt;/SPAN&gt; = &lt;SPAN&gt;"Times New Roman"&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN&gt;Style&lt;/SPAN&gt;.&lt;SPAN&gt;FontSize&lt;/SPAN&gt; = 1&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Makes no difference to the font size or style. The text is approx. 4 times bigger than the other text that is in the border/Title block.&lt;/P&gt;&lt;P&gt;For reference the font size that is used in the title block is 2.5!!!!.....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help so far.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Sep 2020 13:26:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/having-trouble-changing-text-font-size-in-a-drawing-sketch/m-p/9752740#M115997</guid>
      <dc:creator>Chris.Truelove</dc:creator>
      <dc:date>2020-09-17T13:26:42Z</dc:date>
    </item>
    <item>
      <title>Re: Having trouble Changing text font size in a drawing sketch</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/having-trouble-changing-text-font-size-in-a-drawing-sketch/m-p/9752825#M116001</link>
      <description>&lt;P&gt;Sorry I didn't get back with you sooner on this matter in the last post.&amp;nbsp; I got caught away at work.&lt;/P&gt;&lt;P&gt;Here's what I was working on yesterday for you.&lt;/P&gt;&lt;P&gt;There are several lines commented out, just to show some optional possibilities.&lt;/P&gt;&lt;P&gt;I was actually thinking specifying the font and its size by specifying the TextStyle you wanted to use, instead of the more difficult route of specifying the individual Font Name, and Font Size, etc.&lt;/P&gt;&lt;P&gt;Then putting a block of code to check the resulting text size compared to the text box size, then offering some options to help correct any issues, in a few different ways like in the following code.&lt;/P&gt;&lt;P&gt;This code I am testing with an A-Size sheet (8.5 in x 11 in), and have a simple rectangle border that is .25 in from all sides of the sheet.&amp;nbsp; And the rectangle for my text box is being translated to Inches by multiplying by 2.54.&lt;/P&gt;&lt;P&gt;It places the TextBox in the lower left corner of this border (just as an example).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;If ThisApplication.ActiveDocumentType &amp;lt;&amp;gt; DocumentTypeEnum.kDrawingDocumentObject Then
	MsgBox("This rule '" &amp;amp; iLogicVb.RuleName &amp;amp; "' only works for Drawing Documents.",vbOKOnly, "WRONG DOCUMENT TYPE")
	Return
End If

Dim oDDoc As DrawingDocument = ThisDrawing.Document
Dim oSheet As Inventor.Sheet = oDDoc.ActiveSheet
Dim oBorder As Inventor.Border = oSheet.Border

Dim oTStyles As TextStylesEnumerator = oDDoc.StylesManager.TextStyles
Dim oTStyle As TextStyle
Dim oTStylesNames As New List(Of String)
For Each oTStyle In oTStyles
	oTStylesNames.Add(oTStyle.Name)
Next
Dim oTStyleName As String = InputListBox("Select a TextStyle for this TextBox.",oTStylesNames," ","Available TextStyles")
oTStyle = oTStyles.Item(oTStyleName)

Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
Dim oPoint1 As Point2d = oBorder.RangeBox.MinPoint
Dim oPoint2 As Point2d = oTG.CreatePoint2d(oPoint1.X + (3*2.54), oPoint1.Y + (.75*2.54))

Dim oSketch As DrawingSketch = oSheet.Sketches.Add
oSketch.Edit

Dim oText As String = InputBox("Enter new Title Text", " ")

'Dim oFText As String = "&amp;lt;StyleOverride Font='Simplex' FontSize='18' Bold-'True' Italic='False' Underline='False'&amp;gt;" &amp;amp; oText &amp;amp; "&amp;lt;/StyleOverride&amp;gt;"
'Dim oTextBox As Inventor.TextBox = oSketch.TextBoxes.AddByRectangle(oPoint1, oPoint2, oFText)
Dim oTextBox As Inventor.TextBox = oSketch.TextBoxes.AddByRectangle(oPoint1, oPoint2, oText, oTStyle)
'oTextBox.ShowBoundaries = True
'iLogicVb.DocumentUpdate
'MsgBox("There are " &amp;amp; oTextBox.BoundaryGeometry.Count &amp;amp; " entities within oTextBox.BoundaryGeometry.")
'For Each oSE As SketchEntity In oTextBox.BoundaryGeometry
'	oSE.SketchOnly = False
'	oSE.Construction = False
'	oSketch.GeometricConstraints.AddGround(oSE)
'Next
'oTextBox.ShowBoundaries = True
FitCheck :
If oTextBox.FittedTextWidth &amp;gt; oTextBox.Width Then
	oAns = MsgBox("The text is wider than the text box." &amp;amp; vbCrLf &amp;amp; _
	"Do you want to:  Reduce Font Size [Yes], Edit the contents [No], or Leave it that way [Cancel]?", vbYesNoCancel + vbQuestion, " ")
	If oAns = vbYes Then
		oNewTStyleName = InputListBox("Select a TextStyle for this TextBox.",oTStylesNames," ","Available TextStyles")
		oTextBox.Style = oTStyles.Item(oNewTStyleName )
		'Then GoTo FitCheck (the beginning Of this Size Check Process)
		GoTo FitCheck
	ElseIf oAns = vbNo Then
		oTextBox.Text = InputBox("Edit contents.", " ", oTextBox.Text)
		GoTo FitCheck
	End If  'Don't really need to deal with what happens when they choose Cancel.
End If
oSketch.ExitEdit&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know how this works for you.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Sep 2020 14:04:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/having-trouble-changing-text-font-size-in-a-drawing-sketch/m-p/9752825#M116001</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-09-17T14:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: Having trouble Changing text font size in a drawing sketch</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/having-trouble-changing-text-font-size-in-a-drawing-sketch/m-p/9752991#M116007</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks for this,&lt;/P&gt;&lt;P&gt;I'm not sure why but when I click Yes if the text does not fit the box. The option to choose another text style pops up as it is supposed to but when that style is selected the code errors. I do like the way that it uses the styles library and I could easily create a coupe of styles with different font sizes. I think it would be better if it just defaulted to one style for all of the borders except the A4_P border and then used a style that was specific to that border.&lt;/P&gt;&lt;P&gt;I also like the catch that allows the user to edit the text again if they want to. Could this be modified to allow the user to edit that same text&amp;nbsp; if they have already exited this operation. i.e. if a sketch with a text box already exists, can that be edited instead of creating a new sketch and text box.???........&lt;/P&gt;&lt;P&gt;If this is going to take up too much of your time please do not feel obligated to take it further.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Sep 2020 14:42:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/having-trouble-changing-text-font-size-in-a-drawing-sketch/m-p/9752991#M116007</guid>
      <dc:creator>Chris.Truelove</dc:creator>
      <dc:date>2020-09-17T14:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: Having trouble Changing text font size in a drawing sketch</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/having-trouble-changing-text-font-size-in-a-drawing-sketch/m-p/9753103#M116012</link>
      <description>&lt;P&gt;Yes. It can definitely work with an existing DrawingSketch &amp;amp; existing TextBox.&lt;/P&gt;&lt;P&gt;Here's a modified version of my previous code.&lt;/P&gt;&lt;P&gt;(I edited the code in my last post a couple times, right after I posted it to to a misplaced variable name. That may have been what caused the error.)&lt;/P&gt;&lt;P&gt;See if this will work for you.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Sub Main
If ThisApplication.ActiveDocumentType &amp;lt;&amp;gt; DocumentTypeEnum.kDrawingDocumentObject Then
	MsgBox("This rule '" &amp;amp; iLogicVb.RuleName &amp;amp; "' only works for Drawing Documents.",vbOKOnly, "WRONG DOCUMENT TYPE")
	Return
End If

Dim oDDoc As DrawingDocument = ThisDrawing.Document
Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
Dim oSheet As Inventor.Sheet = oDDoc.ActiveSheet
Dim oBorder As Inventor.Border = oSheet.Border
Dim oSketch As DrawingSketch = oSheet.Sketches.Item(1) 'you can supply a name, if it has one
oSketch.Edit
Dim oTextBox As TextBox = oSketch.TextBoxes.Item(1) 'you can supply a name, if it has one

FitCheck :
If oTextBox.FittedTextWidth &amp;gt; oTextBox.Width Then
	oAns = MsgBox("The text is wider than the text box." &amp;amp; vbCrLf &amp;amp; _
	"Do you want to:  Reduce Font Size [Yes], Edit the contents [No], or Leave it that way [Cancel]?", vbYesNoCancel + vbQuestion, " ")
	If oAns = vbYes Then
		oTextBox.Style = GetTStyle(oDDoc)
		GoTo FitCheck
	ElseIf oAns = vbNo Then
		oTextBox.Text = InputBox("Edit contents.", " ", oTextBox.Text)
		GoTo FitCheck
	End If  'Don't really need to deal with what happens when they choose Cancel.
End If
oSketch.ExitEdit
End Sub

Function GetTStyle(ByRef oDoc As Document) As TextStyle
	Dim oTStyles As TextStylesEnumerator = oDoc.StylesManager.TextStyles
	Dim oTStyle As TextStyle
	Dim oTStylesNames As New List(Of String)
	For Each oTStyle In oTStyles
		oTStylesNames.Add(oTStyle.Name)
	Next
	Dim oTStyleName As String = InputListBox("Select a TextStyle for this TextBox.", oTStylesNames, " ", "Available TextStyles")
	oTStyle = oTStyles.Item(oTStyleName)
	Return oTStyle
End Function&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Sep 2020 15:13:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/having-trouble-changing-text-font-size-in-a-drawing-sketch/m-p/9753103#M116012</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-09-17T15:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: Having trouble Changing text font size in a drawing sketch</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/having-trouble-changing-text-font-size-in-a-drawing-sketch/m-p/9753163#M116017</link>
      <description>&lt;P&gt;That was quick!!!!.......&lt;/P&gt;&lt;P&gt;Unfortunately it errors straight away.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error Message;&lt;/P&gt;&lt;P&gt;Error in rule: Test 2, in document: Std_Inventor.dwg&lt;/P&gt;&lt;P&gt;The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;More Info;&lt;/P&gt;&lt;P&gt;System.ArgumentException: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))&lt;BR /&gt;at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&amp;amp; msgData)&lt;BR /&gt;at Inventor.DrawingSketches.get_Item(Object Index)&lt;BR /&gt;at ThisRule.Main()&lt;BR /&gt;at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)&lt;BR /&gt;at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Sep 2020 15:32:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/having-trouble-changing-text-font-size-in-a-drawing-sketch/m-p/9753163#M116017</guid>
      <dc:creator>Chris.Truelove</dc:creator>
      <dc:date>2020-09-17T15:32:42Z</dc:date>
    </item>
  </channel>
</rss>

