<?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: Can't see text in drawing created from code, but qselect finds it in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/can-t-see-text-in-drawing-created-from-code-but-qselect-finds-it/m-p/5795044#M38806</link>
    <description>&lt;P&gt;1) layer of entity is off? &lt;/P&gt;
&lt;P&gt;2) Also I've not found&lt;/P&gt;
&lt;PRE&gt;theTextLabel.&lt;STRONG&gt;&lt;SPAN style="color: #660000;"&gt;AdjustAlignment&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/PRE&gt;
&lt;P&gt;3) Heigth of text is 0? &lt;/P&gt;</description>
    <pubDate>Sun, 30 Aug 2015 21:02:30 GMT</pubDate>
    <dc:creator>Alexander.Rivilis</dc:creator>
    <dc:date>2015-08-30T21:02:30Z</dc:date>
    <item>
      <title>Can't see text in drawing created from code, but qselect finds it</title>
      <link>https://forums.autodesk.com/t5/net-forum/can-t-see-text-in-drawing-created-from-code-but-qselect-finds-it/m-p/5793796#M38801</link>
      <description>&lt;P&gt;I'm adding text to a drawing via this code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;                        Dim theTextLabel As New Autodesk.AutoCAD.DatabaseServices.DBText()
                        theTextLabel.SetDatabaseDefaults()
                        'theTextLabel.Height = 5
                        theTextLabel.TextString = Me.ctlPID.Text
                        theTextLabel.Position = New Point3d(centroid(0), centroid(1), 0)
                        theTextLabel.Justify = AttachmentPoint.MiddleCenter
                        btr.AppendEntity(theTextLabel)
                        trans.AddNewlyCreatedDBObject(theTextLabel, True)&lt;/PRE&gt;&lt;P&gt;In the drawing, you can't see the text at all, and you can't select it with the cursor or draw a box around it.But if you qselect, you can find it, and it gets selected. The contents are correct, but no matter what I change ) be it the font, size, etc it never shows up as visible in the drawing. Any ideas?? I'm totally stumped here...&lt;/P&gt;</description>
      <pubDate>Fri, 28 Aug 2015 19:37:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/can-t-see-text-in-drawing-created-from-code-but-qselect-finds-it/m-p/5793796#M38801</guid>
      <dc:creator>andrew_demerchant</dc:creator>
      <dc:date>2015-08-28T19:37:12Z</dc:date>
    </item>
    <item>
      <title>Re: Can't see text in drawing created from code, but qselect finds it</title>
      <link>https://forums.autodesk.com/t5/net-forum/can-t-see-text-in-drawing-created-from-code-but-qselect-finds-it/m-p/5793880#M38802</link>
      <description>&lt;P&gt;You should set a text style (theTextLabel.TextStyleId = the object id of the text style to use).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/net/trouble-getting-textsize-of-a-known-textstyle/m-p/5368743#M42299" target="_self"&gt;&amp;gt;&amp;gt;check here&amp;lt;&amp;lt;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Aug 2015 20:22:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/can-t-see-text-in-drawing-created-from-code-but-qselect-finds-it/m-p/5793880#M38802</guid>
      <dc:creator>fieldguy</dc:creator>
      <dc:date>2015-08-28T20:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: Can't see text in drawing created from code, but qselect finds it</title>
      <link>https://forums.autodesk.com/t5/net-forum/can-t-see-text-in-drawing-created-from-code-but-qselect-finds-it/m-p/5793886#M38803</link>
      <description>It's got a style though - it's set via theTextLabel.SetDatabaseDefaults(), and when I see it's properties in cad, it's right - it's using my template's default style.</description>
      <pubDate>Fri, 28 Aug 2015 20:28:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/can-t-see-text-in-drawing-created-from-code-but-qselect-finds-it/m-p/5793886#M38803</guid>
      <dc:creator>andrew_demerchant</dc:creator>
      <dc:date>2015-08-28T20:28:06Z</dc:date>
    </item>
    <item>
      <title>Re : Can't see text in drawing created from code, but qselect finds it</title>
      <link>https://forums.autodesk.com/t5/net-forum/can-t-see-text-in-drawing-created-from-code-but-qselect-finds-it/m-p/5794173#M38804</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As the DBText.Justify property is different from AttachmentPoint.BaseLeft, you have to specify the DBText.AlignmentPoint property.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try with:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;theTextLabel.Position = Point3d.Origin
theTextLabel.Justify = AttachmentPoint.MiddleCenter
theTextLabel.AlignmentPoint = New Point3d(centroid(0), centroid(1), 0)&lt;/PRE&gt;</description>
      <pubDate>Sat, 29 Aug 2015 06:30:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/can-t-see-text-in-drawing-created-from-code-but-qselect-finds-it/m-p/5794173#M38804</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2015-08-29T06:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: Can't see text in drawing created from code, but qselect finds it</title>
      <link>https://forums.autodesk.com/t5/net-forum/can-t-see-text-in-drawing-created-from-code-but-qselect-finds-it/m-p/5794562#M38805</link>
      <description>Even if I leave out the justify altogether, it's still the same problem.</description>
      <pubDate>Sat, 29 Aug 2015 21:02:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/can-t-see-text-in-drawing-created-from-code-but-qselect-finds-it/m-p/5794562#M38805</guid>
      <dc:creator>andrew_demerchant</dc:creator>
      <dc:date>2015-08-29T21:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: Can't see text in drawing created from code, but qselect finds it</title>
      <link>https://forums.autodesk.com/t5/net-forum/can-t-see-text-in-drawing-created-from-code-but-qselect-finds-it/m-p/5795044#M38806</link>
      <description>&lt;P&gt;1) layer of entity is off? &lt;/P&gt;
&lt;P&gt;2) Also I've not found&lt;/P&gt;
&lt;PRE&gt;theTextLabel.&lt;STRONG&gt;&lt;SPAN style="color: #660000;"&gt;AdjustAlignment&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/PRE&gt;
&lt;P&gt;3) Heigth of text is 0? &lt;/P&gt;</description>
      <pubDate>Sun, 30 Aug 2015 21:02:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/can-t-see-text-in-drawing-created-from-code-but-qselect-finds-it/m-p/5795044#M38806</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2015-08-30T21:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: Can't see text in drawing created from code, but qselect finds it</title>
      <link>https://forums.autodesk.com/t5/net-forum/can-t-see-text-in-drawing-created-from-code-but-qselect-finds-it/m-p/5795150#M38807</link>
      <description>Layers are all on - height isn't zero.</description>
      <pubDate>Mon, 31 Aug 2015 00:06:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/can-t-see-text-in-drawing-created-from-code-but-qselect-finds-it/m-p/5795150#M38807</guid>
      <dc:creator>andrew_demerchant</dc:creator>
      <dc:date>2015-08-31T00:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: Can't see text in drawing created from code, but qselect finds it</title>
      <link>https://forums.autodesk.com/t5/net-forum/can-t-see-text-in-drawing-created-from-code-but-qselect-finds-it/m-p/5796069#M38808</link>
      <description>Are you debugging with Visual Studio?&lt;BR /&gt;Is the text also invisible when opening the DWG outside of visualStudio?&lt;BR /&gt;</description>
      <pubDate>Mon, 31 Aug 2015 16:14:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/can-t-see-text-in-drawing-created-from-code-but-qselect-finds-it/m-p/5796069#M38808</guid>
      <dc:creator>SENL1362</dc:creator>
      <dc:date>2015-08-31T16:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: Can't see text in drawing created from code, but qselect finds it</title>
      <link>https://forums.autodesk.com/t5/net-forum/can-t-see-text-in-drawing-created-from-code-but-qselect-finds-it/m-p/5796190#M38809</link>
      <description>&lt;P&gt;Ah - now we're getting somewhere...that was debugging. Seems that when I run it for real (or even save from debugging and then re-open) there's a slightly different, though still weird, result.&lt;BR /&gt;&lt;BR /&gt;If I save the debug dwg, and then open it normally, I can actually see and select my text - but here's the weird part...if I try to do something to it, it moves to 0,0...so that goes for changing layers, changing the height, or running a command on it like move, etc.&lt;BR /&gt;&lt;BR /&gt;If I run the compiled code without debugging, I get something closer to the end result above...I get my txt at 0,0 (which isn't where it's supposed to be). There's definitely something screwy going on with my text entity....just no idea what....&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2015 17:18:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/can-t-see-text-in-drawing-created-from-code-but-qselect-finds-it/m-p/5796190#M38809</guid>
      <dc:creator>andrew_demerchant</dc:creator>
      <dc:date>2015-08-31T17:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: Can't see text in drawing created from code, but qselect finds it</title>
      <link>https://forums.autodesk.com/t5/net-forum/can-t-see-text-in-drawing-created-from-code-but-qselect-finds-it/m-p/5796234#M38810</link>
      <description>I currently can't run Visual but there are some settings you have to alter to see text in a debugged session.&lt;BR /&gt;I will send you these settings first thing tomorrow morning if not posted before by any one else on this forum.&lt;BR /&gt;</description>
      <pubDate>Mon, 31 Aug 2015 17:41:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/can-t-see-text-in-drawing-created-from-code-but-qselect-finds-it/m-p/5796234#M38810</guid>
      <dc:creator>SENL1362</dc:creator>
      <dc:date>2015-08-31T17:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: Can't see text in drawing created from code, but qselect finds it</title>
      <link>https://forums.autodesk.com/t5/net-forum/can-t-see-text-in-drawing-created-from-code-but-qselect-finds-it/m-p/5796241#M38811</link>
      <description>Thanks! Any thoughts on why it's moving? I'm guessing that even if I get it to show up in the debug session, I'm still going to be left with that problem...</description>
      <pubDate>Mon, 31 Aug 2015 17:48:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/can-t-see-text-in-drawing-created-from-code-but-qselect-finds-it/m-p/5796241#M38811</guid>
      <dc:creator>andrew_demerchant</dc:creator>
      <dc:date>2015-08-31T17:48:08Z</dc:date>
    </item>
    <item>
      <title>Re: Can't see text in drawing created from code, but qselect finds it</title>
      <link>https://forums.autodesk.com/t5/net-forum/can-t-see-text-in-drawing-created-from-code-but-qselect-finds-it/m-p/5796310#M38812</link>
      <description>no clue</description>
      <pubDate>Mon, 31 Aug 2015 18:21:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/can-t-see-text-in-drawing-created-from-code-but-qselect-finds-it/m-p/5796310#M38812</guid>
      <dc:creator>SENL1362</dc:creator>
      <dc:date>2015-08-31T18:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: Can't see text in drawing created from code, but qselect finds it</title>
      <link>https://forums.autodesk.com/t5/net-forum/can-t-see-text-in-drawing-created-from-code-but-qselect-finds-it/m-p/5796382#M38813</link>
      <description>The plot thickens - knowing that text doesn't show up right in a debug session, I was able to make use of _gile's suggestion to set the AlignmentPoint property. That at least makes the text not move to the origin when a property is changed in a normal session. But it does still move...I tried AdjustAlignment, but that seems to make no difference.</description>
      <pubDate>Mon, 31 Aug 2015 18:46:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/can-t-see-text-in-drawing-created-from-code-but-qselect-finds-it/m-p/5796382#M38813</guid>
      <dc:creator>andrew_demerchant</dc:creator>
      <dc:date>2015-08-31T18:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: Can't see text in drawing created from code, but qselect finds it</title>
      <link>https://forums.autodesk.com/t5/net-forum/can-t-see-text-in-drawing-created-from-code-but-qselect-finds-it/m-p/5796976#M38814</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In order to show text while debuging, you need to set:&lt;/P&gt;&lt;P&gt;Use Legacy Managed Engine = YES&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/186414i947180B2DEDF2E35/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="Screenshot_2.png" title="Screenshot_2.png" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sometimes i needed these settings as well:&lt;/P&gt;&lt;P&gt;C#/AutoCAD/Visual Studio 2013/x64/debug/AutoCAD text errors/Undefined shape&lt;BR /&gt;Tools&amp;gt;Options&amp;gt;Debugging&amp;gt;Managed Compatibility Mode=ON&lt;BR /&gt;(Select Projext X): Project&amp;gt;Properties&amp;gt;Debug&amp;gt;Enable native code debugging=On&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Sep 2015 06:30:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/can-t-see-text-in-drawing-created-from-code-but-qselect-finds-it/m-p/5796976#M38814</guid>
      <dc:creator>SENL1362</dc:creator>
      <dc:date>2015-09-01T06:30:22Z</dc:date>
    </item>
    <item>
      <title>Re: Can't see text in drawing created from code, but qselect finds it</title>
      <link>https://forums.autodesk.com/t5/net-forum/can-t-see-text-in-drawing-created-from-code-but-qselect-finds-it/m-p/5797405#M38815</link>
      <description>&lt;P&gt;Thanks! I'm using VS Express, so I had to make that change via a project file edit, but that did the trick. Oddly enough, after making that change, my text shows up in the right spot, and no longer moves on it's own after changing properties...very strange to me that a debugging engine change would affect the final biuld, but it seems to. I'm not going to complain, since my problem is seemingly solved. For what it's worth, this is my final working code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;                        Dim theTextLabel As New Autodesk.AutoCAD.DatabaseServices.DBText()
                        theTextLabel.SetDatabaseDefaults()
                        theTextLabel.Height = 5
                        theTextLabel.TextString = Me.ctlPID.Text

                        theTextLabel.Position = New Point3d(centroid(0), centroid(1), 0)
                        theTextLabel.Annotative = AnnotativeStates.False

                        theTextLabel.Justify = AttachmentPoint.MiddleCenter
                        theTextLabel.AlignmentPoint = New Point3d(centroid(0), centroid(1), 0)
                        theTextLabel.AdjustAlignment(db)

                        btr.AppendEntity(theTextLabel)&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Sep 2015 12:22:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/can-t-see-text-in-drawing-created-from-code-but-qselect-finds-it/m-p/5797405#M38815</guid>
      <dc:creator>andrew_demerchant</dc:creator>
      <dc:date>2015-09-01T12:22:18Z</dc:date>
    </item>
  </channel>
</rss>

