<?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: Width of DBText in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/width-of-dbtext/m-p/12869152#M3470</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4114680"&gt;@youssefGC&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's fine, but not obvious from your original question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 29 Jun 2024 21:46:40 GMT</pubDate>
    <dc:creator>kerry_w_brown</dc:creator>
    <dc:date>2024-06-29T21:46:40Z</dc:date>
    <item>
      <title>Width of DBText</title>
      <link>https://forums.autodesk.com/t5/net-forum/width-of-dbtext/m-p/12864397#M3462</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Normally the width of the text depends on the number of characters, I need a method to know the width of a DBText in my drawing, is it possible to do this by programming?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="youssefGC_0-1719482925426.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1380605i6CACA964E177591C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="youssefGC_0-1719482925426.png" alt="youssefGC_0-1719482925426.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;using (DBText Txt = new DBText())
            {
                // ......

                Txt.TextString = "I need to read the width of this text";

                // ......
            }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&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;</description>
      <pubDate>Thu, 27 Jun 2024 10:09:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/width-of-dbtext/m-p/12864397#M3462</guid>
      <dc:creator>youssefGC</dc:creator>
      <dc:date>2024-06-27T10:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: Width of DBText</title>
      <link>https://forums.autodesk.com/t5/net-forum/width-of-dbtext/m-p/12864507#M3463</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;You can P/Invoke acedTextBox as shown in the &lt;A href="https://github.com/gileCAD/Gile.AutoCAD.Extension/blob/master/Gile.AutoCAD.R20.Extension/DBTextExtension.cs" target="_blank" rel="noopener"&gt;DBTextExtension&lt;/A&gt; class (GetTextBoxCorners method) from &lt;A href="https://github.com/gileCAD/Gile.AutoCAD.Extension" target="_blank" rel="noopener"&gt;Gile.AutoCAD.Extension library&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 11:17:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/width-of-dbtext/m-p/12864507#M3463</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2024-06-27T11:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: Width of DBText</title>
      <link>https://forums.autodesk.com/t5/net-forum/width-of-dbtext/m-p/12864939#M3464</link>
      <description>&lt;P&gt;AcDbText::getBoundingPoints isn’t in .NET?&lt;/P&gt;&lt;P&gt;you may be able to put the contents in an MText, then&lt;/P&gt;&lt;P&gt;call AcDbMText::getBoundingPoints&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 14:10:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/width-of-dbtext/m-p/12864939#M3464</guid>
      <dc:creator>daniel_cadext</dc:creator>
      <dc:date>2024-06-27T14:10:41Z</dc:date>
    </item>
    <item>
      <title>Re: Width of DBText</title>
      <link>https://forums.autodesk.com/t5/net-forum/width-of-dbtext/m-p/12867128#M3465</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;I use "Extents Box" to calculate the dimensions width height of the text :&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public double GetLengthOfText(DBText txt, ObjectId IdOfStyle)
        {
            double width = 0.0, height = 0.0;
            Autodesk.AutoCAD.GraphicsInterface.TextStyle iStyle = new Autodesk.AutoCAD.GraphicsInterface.TextStyle();
            iStyle.FromTextStyleTableRecord(IdOfStyle);
            Extents2d extents = iStyle.ExtentsBox(txt.TextString, true, true, null);
            width = extents.MaxPoint.X - extents.MinPoint.X;
            height = extents.MaxPoint.Y - extents.MinPoint.Y;

            return width * (txt.Height / height);  
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2024 13:58:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/width-of-dbtext/m-p/12867128#M3465</guid>
      <dc:creator>youssefGC</dc:creator>
      <dc:date>2024-06-28T13:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: Width of DBText</title>
      <link>https://forums.autodesk.com/t5/net-forum/width-of-dbtext/m-p/12867868#M3466</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use a variation of this :&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.theswamp.org/index.php?topic=50493.msg556106#msg556106" target="_blank"&gt;https://www.theswamp.org/index.php?topic=50493.msg556106#msg556106&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Handy for determining the space text will occupy, without necessarily having the Text object.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2024 20:08:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/width-of-dbtext/m-p/12867868#M3466</guid>
      <dc:creator>kerry_w_brown</dc:creator>
      <dc:date>2024-06-28T20:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: Width of DBText</title>
      <link>https://forums.autodesk.com/t5/net-forum/width-of-dbtext/m-p/12868103#M3467</link>
      <description>&lt;P&gt;That’s pretty slick, you could use that to pre calculate table column widths&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2024 22:55:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/width-of-dbtext/m-p/12868103#M3467</guid>
      <dc:creator>daniel_cadext</dc:creator>
      <dc:date>2024-06-28T22:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: Width of DBText</title>
      <link>https://forums.autodesk.com/t5/net-forum/width-of-dbtext/m-p/12868147#M3468</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8575899"&gt;@daniel_cadext&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;That’s pretty slick, you could use that to pre calculate table column widths&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Exactly !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also handy when auto-choosing an Item_Balloon which is a suitable length to use for component 'numbers'&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-06-29_11-48-42.jpg" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1381373i97DE40B8353376CF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="2024-06-29_11-48-42.jpg" alt="2024-06-29_11-48-42.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2024 23:51:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/width-of-dbtext/m-p/12868147#M3468</guid>
      <dc:creator>kerry_w_brown</dc:creator>
      <dc:date>2024-06-28T23:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: Width of DBText</title>
      <link>https://forums.autodesk.com/t5/net-forum/width-of-dbtext/m-p/12868610#M3469</link>
      <description>&lt;P&gt;Thank you, but in my case I have to pass a DbText in the argument to take into consideration the change in text height in my main code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Jun 2024 10:23:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/width-of-dbtext/m-p/12868610#M3469</guid>
      <dc:creator>youssefGC</dc:creator>
      <dc:date>2024-06-29T10:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: Width of DBText</title>
      <link>https://forums.autodesk.com/t5/net-forum/width-of-dbtext/m-p/12869152#M3470</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4114680"&gt;@youssefGC&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's fine, but not obvious from your original question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Jun 2024 21:46:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/width-of-dbtext/m-p/12869152#M3470</guid>
      <dc:creator>kerry_w_brown</dc:creator>
      <dc:date>2024-06-29T21:46:40Z</dc:date>
    </item>
  </channel>
</rss>

