<?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 Error in definition of Drawable.Bounds in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/error-in-definition-of-drawable-bounds/m-p/4343266#M48533</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just ran into an odd problem with the Bounds method (inherited by all DBObjects).&amp;nbsp; I was attempting to us it like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dim bounds As Extents3d = txt.Bounds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but VB stated:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error&amp;nbsp;&amp;nbsp; &amp;nbsp;3&amp;nbsp;&amp;nbsp; &amp;nbsp;Option Strict On disallows implicit conversions from 'Autodesk.AutoCAD.DatabaseServices.Extents3d?' to 'Autodesk.AutoCAD.DatabaseServices.Extents3d'.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I looked to see where that question mark was coming from and if there was another class that I hadn't heard of.&amp;nbsp; It turns out that in the type library, it is defined as:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Public Overridable ReadOnly Property Bounds As Autodesk.AutoCAD.DatabaseServices.Extents3d?&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Member of Autodesk.AutoCAD.GraphicsInterface.Drawable&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;This really seems like an error in the type library, how do I ask Autodesk to fix it?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dim bounds As Extents3d = DirectCast(txt.Bounds, Extents3d)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;does not work since there is not a inheritance or implementation relationship to the typo.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dim bounds As Extents3d = CType(txt.Bounds, Extents3d)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;seems to work, but how do I get someone to fix the underlying problem?&amp;nbsp; I think it effects every entity in the database since they all inherit from Drawable.&amp;nbsp; Or did they do this on purpose for reasons that are beyond me?&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;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 25 Jul 2013 16:00:47 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-07-25T16:00:47Z</dc:date>
    <item>
      <title>Error in definition of Drawable.Bounds</title>
      <link>https://forums.autodesk.com/t5/net-forum/error-in-definition-of-drawable-bounds/m-p/4343266#M48533</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just ran into an odd problem with the Bounds method (inherited by all DBObjects).&amp;nbsp; I was attempting to us it like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dim bounds As Extents3d = txt.Bounds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but VB stated:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error&amp;nbsp;&amp;nbsp; &amp;nbsp;3&amp;nbsp;&amp;nbsp; &amp;nbsp;Option Strict On disallows implicit conversions from 'Autodesk.AutoCAD.DatabaseServices.Extents3d?' to 'Autodesk.AutoCAD.DatabaseServices.Extents3d'.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I looked to see where that question mark was coming from and if there was another class that I hadn't heard of.&amp;nbsp; It turns out that in the type library, it is defined as:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Public Overridable ReadOnly Property Bounds As Autodesk.AutoCAD.DatabaseServices.Extents3d?&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Member of Autodesk.AutoCAD.GraphicsInterface.Drawable&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;This really seems like an error in the type library, how do I ask Autodesk to fix it?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dim bounds As Extents3d = DirectCast(txt.Bounds, Extents3d)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;does not work since there is not a inheritance or implementation relationship to the typo.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dim bounds As Extents3d = CType(txt.Bounds, Extents3d)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;seems to work, but how do I get someone to fix the underlying problem?&amp;nbsp; I think it effects every entity in the database since they all inherit from Drawable.&amp;nbsp; Or did they do this on purpose for reasons that are beyond me?&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;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2013 16:00:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/error-in-definition-of-drawable-bounds/m-p/4343266#M48533</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-25T16:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: Error in definition of Drawable.Bounds</title>
      <link>https://forums.autodesk.com/t5/net-forum/error-in-definition-of-drawable-bounds/m-p/4343303#M48534</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;...&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;This really seems like an error in the type library, how do I ask Autodesk to fix it?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;There is nothing to fix in AutoCAD API. DbObject.Bounds is a Nullable&amp;lt;T&amp;gt; type, where T is Extents3d, which is not the same as type Extents3d., that is why you get error when in VB.NET you set "Strict On" and when you cannot DirectCats(...) it. if you use C#, you get the same error.&lt;/P&gt;&lt;P&gt;You get a Extents3d value from Extents3d? (or any Nullable&amp;lt;T&amp;gt; types)&amp;nbsp;by Nullable&amp;lt;T&amp;gt;.Value,&amp;nbsp;only if the Nullable&amp;lt;T&amp;gt;.HasValue is true.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2013 16:25:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/error-in-definition-of-drawable-bounds/m-p/4343303#M48534</guid>
      <dc:creator>Norman_Yuan</dc:creator>
      <dc:date>2013-07-25T16:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: Error in definition of Drawable.Bounds</title>
      <link>https://forums.autodesk.com/t5/net-forum/error-in-definition-of-drawable-bounds/m-p/4343490#M48535</link>
      <description>&lt;P&gt;Ah, thank you.&amp;nbsp; I have not used nullable much myself and much of the sample code I read when it first came out used the "Nullable(Of" or &lt;SPAN&gt;Nullable&amp;lt;T&amp;gt;&lt;/SPAN&gt; syntax, rather than the ? thus I did not recognise the operator.&amp;nbsp; Not surprisingly "?" does not work well in search engines.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can see why it would be useful to be nullable on a Text object since if the text string is empty, there would be no bounding box.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am now using the following construction in my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If txt.Bounds.HasValue Then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; bounds = txt.Bounds.Value&lt;/P&gt;&lt;P&gt;Else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2013 19:16:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/error-in-definition-of-drawable-bounds/m-p/4343490#M48535</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-25T19:16:17Z</dc:date>
    </item>
  </channel>
</rss>

