<?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 entity type in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/entity-type/m-p/10302659#M3359</link>
    <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use c++. When user select an entity, I want to find out the entity type.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Certainly I can use:&amp;nbsp;AcDb3dSolid::cast(obj) or similar approach to find the right type I need. But I want to know is there are other ways to find the entity type.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;Eric&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 10 May 2021 13:29:42 GMT</pubDate>
    <dc:creator>johnteng00</dc:creator>
    <dc:date>2021-05-10T13:29:42Z</dc:date>
    <item>
      <title>entity type</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/entity-type/m-p/10302659#M3359</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use c++. When user select an entity, I want to find out the entity type.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Certainly I can use:&amp;nbsp;AcDb3dSolid::cast(obj) or similar approach to find the right type I need. But I want to know is there are other ways to find the entity type.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;Eric&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 May 2021 13:29:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/entity-type/m-p/10302659#M3359</guid>
      <dc:creator>johnteng00</dc:creator>
      <dc:date>2021-05-10T13:29:42Z</dc:date>
    </item>
    <item>
      <title>回复： entity type</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/entity-type/m-p/10303946#M3360</link>
      <description>&lt;LI-CODE lang="cpp"&gt;ent-&amp;gt;isA()==AcDb3dSolid::desc()
ent-&amp;gt;isKindOf(AcDb3dSolid::desc())&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 11 May 2021 00:26:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/entity-type/m-p/10303946#M3360</guid>
      <dc:creator>hbxiaogui</dc:creator>
      <dc:date>2021-05-11T00:26:33Z</dc:date>
    </item>
    <item>
      <title>回复： entity type</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/entity-type/m-p/10304054#M3361</link>
      <description>&lt;P&gt;good, thank you for your reply.&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 02:02:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/entity-type/m-p/10304054#M3361</guid>
      <dc:creator>johnteng00</dc:creator>
      <dc:date>2021-05-11T02:02:27Z</dc:date>
    </item>
    <item>
      <title>回复： entity type</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/entity-type/m-p/10304820#M3362</link>
      <description>&lt;P&gt;You can also use&amp;nbsp;&amp;nbsp; &lt;FONT face="courier new,courier"&gt;AcRxClass* AcDbObjectId::objectClass()&lt;/FONT&gt; &lt;FONT face="courier new,courier"&gt;const&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; to query the class from the&amp;nbsp;&lt;FONT face="courier new,courier"&gt;AcDbObjectId&lt;/FONT&gt; without even opening the object.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sometimes you might also want to test for a base class:&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;ent-&amp;gt;isDerivedFrom(AcDbDimension::desc())&lt;/LI-CODE&gt;
&lt;P&gt;This would be true if &lt;FONT face="courier new,courier"&gt;ent&lt;/FONT&gt; is any kind of dimension.&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 09:42:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/entity-type/m-p/10304820#M3362</guid>
      <dc:creator>tbrammer</dc:creator>
      <dc:date>2021-05-11T09:42:04Z</dc:date>
    </item>
    <item>
      <title>回复： entity type</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/entity-type/m-p/10310880#M3363</link>
      <description>&lt;P&gt;Just to clarify, &lt;STRONG&gt;isKindOf&lt;/STRONG&gt;() is a method of &lt;STRONG&gt;AcRxObject&lt;/STRONG&gt;, while&amp;nbsp;&lt;STRONG&gt;isDerivedFrom&lt;/STRONG&gt;() is a method of &lt;STRONG&gt;AcRxClass&lt;/STRONG&gt;.&amp;nbsp; So the method you want to call depends on whether you're pointing to the entity or to its class object.&amp;nbsp; If &lt;STRONG&gt;ent&lt;/STRONG&gt; points to an AcDbEntity and &lt;STRONG&gt;id&lt;/STRONG&gt; is its AcDbObjectId, then you can check for it being a dimension in these ways:&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;ent-&amp;gt;isKindOf(AcDbDimension::desc())
// or:
ent-&amp;gt;isA()-&amp;gt;isDerivedFrom(AcDbDimension::desc())
// or:
id.objectClass()-&amp;gt;isDerivedFrom(AcDbDimension::desc())
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;And to make it more confusing, AcRxClass itself is derived from AcRxObject, so it's possible, although usually incorrect and unintended, to do this:&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;id.objectClass()-&amp;gt;isKindOf(AcDbDimension::desc())
&lt;/LI-CODE&gt;
&lt;P&gt;That will always return &lt;STRONG&gt;false&lt;/STRONG&gt; because objectClass() returns a pointer to an AcRxClass object, and AcRxClass itself is not derived from AcDbDimension. It derives directly from AcRxObject.&lt;/P&gt;</description>
      <pubDate>Thu, 13 May 2021 14:52:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/entity-type/m-p/10310880#M3363</guid>
      <dc:creator>autodaug</dc:creator>
      <dc:date>2021-05-13T14:52:11Z</dc:date>
    </item>
  </channel>
</rss>

