<?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: AcadEntity in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/acadentity/m-p/10140872#M17279</link>
    <description>&lt;P&gt;Well, if you use "EntityType", which is an "int" in the "if..." statement, you need to know all possible numbers used for EntityType. Alternatively, you can use EntityName or ObjectName property, in which case you need to know all possible EntityName/ObjectName.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you can also use "is" keyword:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if (entities[i] is AcadLine)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; ...&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;else if (entities[i] is AcadCircle)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; ...&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;else ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Of course, you'll need to test all possible AcadXxxxx entity types.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As for finding Text (AcadText/AcadMText) in an AcadBlock, you loop through an instance of an AcadBlock to test each component entity in AcadBlock is AcadText/AcadMText.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, are you sure you want to find text in AcadBlock, not attributes in an AcadBlockReference? In your "entities" collection, there could only be some of the entities are AcadBlockReferences, not AcadBlock, which is not an AcadEntity.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Mar 2021 03:09:35 GMT</pubDate>
    <dc:creator>norman.yuan</dc:creator>
    <dc:date>2021-03-09T03:09:35Z</dc:date>
    <item>
      <title>AcadEntity</title>
      <link>https://forums.autodesk.com/t5/net-forum/acadentity/m-p/10139071#M17276</link>
      <description>&lt;DIV class="lia-message-body lia-component-message-view-widget-body lia-component-body-signature-highlight-escalation lia-component-message-view-widget-body-signature-highlight-escalation"&gt;&lt;DIV class="lia-message-body-content"&gt;&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been trying to integrate DWG functionality in a software that I am assisting in creating, and need a little bit of help.&lt;/P&gt;&lt;P&gt;In order to extract specific entities from an active document, I've began using the "EntityType" attribute of an AcadEntity. However I can't find any references as to what each of the numbers represent and have had to manually test to find it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i.e: EntityType = 21 references AcadMText&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EntityType = 4 references AcadArc&lt;/P&gt;&lt;P&gt;so on and so forth&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also have an issue where I can't extract any information from AcadBlocks such as the text within it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know if there's a proper object reference sheet for this?&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 08 Mar 2021 15:27:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/acadentity/m-p/10139071#M17276</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-08T15:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: AcadEntity</title>
      <link>https://forums.autodesk.com/t5/net-forum/acadentity/m-p/10139407#M17277</link>
      <description>&lt;P&gt;hi, if you can answer the following questions maybe someone will participate to help&lt;/P&gt;&lt;P&gt;Q1: you developing a plugin using C#? yes/no&lt;/P&gt;&lt;P&gt;Q2: you want to be able to select acad objects and classify them based on their types? yes/no&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;and regarding the last question you can find Autocad developer reference guide here&amp;nbsp;&lt;A href="https://help.autodesk.com/view/OARX/2020/ENU/?guid=OARX-ManagedRefGuide-Autodesk_AutoCAD" target="_blank"&gt;AutoCAD 2020 Developer and ObjectARX Help: Autodesk.AutoCAD Namespace&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 16:53:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/acadentity/m-p/10139407#M17277</guid>
      <dc:creator>essam-salah</dc:creator>
      <dc:date>2021-03-08T16:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: AcadEntity</title>
      <link>https://forums.autodesk.com/t5/net-forum/acadentity/m-p/10140597#M17278</link>
      <description>&lt;P&gt;1) It's not a plug-in per se, but rather a module for an existing software product. For now we're just testing the extraction of objects from an active ACAD document using the AutoCAD SDK-- but yes it is in C#. Eventually we want to switch to RealDWG once a trial exists for it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) Yes-- we're trying to extract information from the document in order to convert it into a more legible form in our software package.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;//entities is a List of AcadEntities
for (int i = 0; i &amp;lt; entities.Count; i++)
{
    if (entities[i].EntityType == 19)
    {                                 

        AcadLine templine = (AcadLine)entities[i];

        coordinate.start = templine.StartPoint; //coordinate is a struct
        coordinate.end = templine.EndPoint;

        lines.Add(coordinate); //lines is a List of structs
    }
    else if(entities[i].EntityType == 4)
    {

        AcadArc tempArc = (AcadArc)entities[i];

        info.start = tempArc.StartPoint; //info is a struct
        info.end = tempArc.EndPoint;
        info.radius = tempArc.Radius;
        info.startAngle = tempArc.StartAngle;
        info.endAngle = tempArc.EndAngle;
        info.length = tempArc.ArcLength;

        arcs.Add(info); //arcs is a List of structs
    }
    else if (entities[i].EntityType == 21)
    {
        AcadMText tempText = (AcadMText) entities[i];

        txt.start = tempText.InsertionPoint; //txt is a struct
        txt.height = tempText.Height;
        txt.width = tempText.Width;
        txt.content = tempText.TextString;

        texts.Add(txt); //texts is a List of structs
    }
}&lt;/LI-CODE&gt;&lt;P&gt;This code is rudimentary and temporary, but it's the type of extraction I'm looking to do.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Mar 2021 00:05:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/acadentity/m-p/10140597#M17278</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-09T00:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: AcadEntity</title>
      <link>https://forums.autodesk.com/t5/net-forum/acadentity/m-p/10140872#M17279</link>
      <description>&lt;P&gt;Well, if you use "EntityType", which is an "int" in the "if..." statement, you need to know all possible numbers used for EntityType. Alternatively, you can use EntityName or ObjectName property, in which case you need to know all possible EntityName/ObjectName.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you can also use "is" keyword:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if (entities[i] is AcadLine)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; ...&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;else if (entities[i] is AcadCircle)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; ...&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;else ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Of course, you'll need to test all possible AcadXxxxx entity types.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As for finding Text (AcadText/AcadMText) in an AcadBlock, you loop through an instance of an AcadBlock to test each component entity in AcadBlock is AcadText/AcadMText.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, are you sure you want to find text in AcadBlock, not attributes in an AcadBlockReference? In your "entities" collection, there could only be some of the entities are AcadBlockReferences, not AcadBlock, which is not an AcadEntity.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Mar 2021 03:09:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/acadentity/m-p/10140872#M17279</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2021-03-09T03:09:35Z</dc:date>
    </item>
    <item>
      <title>Re: AcadEntity</title>
      <link>https://forums.autodesk.com/t5/net-forum/acadentity/m-p/10142393#M17280</link>
      <description>&lt;P&gt;Oh! I wasn't aware that the&amp;nbsp;&lt;EM&gt;is&lt;/EM&gt; keyword worked that way. That's very helpful!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did mean AcadBlockReference and not AcadBlock, thank you for catching me on that! I'm not sure how to extract text information and other values from references that refer to transformers and other such components.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again!&lt;/P&gt;</description>
      <pubDate>Tue, 09 Mar 2021 15:31:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/acadentity/m-p/10142393#M17280</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-09T15:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: AcadEntity</title>
      <link>https://forums.autodesk.com/t5/net-forum/acadentity/m-p/10143170#M17281</link>
      <description>&lt;P&gt;Again, when you say "extrac text information ... from [Block] reference...", do you mean Text/MText that user sees as part of block (reference), or Attribute (AttributeReference)? If you do mean Text/MText seen in the block reference, you have to trace back to the block reference's block definition (remember, all references to the same block definition have THE SAME TEXT/MTEXT!); while if it is actually Attribute you are after, the each block reference of the same block definition may have the same attributes (i.e. their tags are the same) with different values. You want to make it clear what you extract from block reference is: Text as defined in the block definition, or attribute values that is unique with each block reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Mar 2021 20:00:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/acadentity/m-p/10143170#M17281</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2021-03-09T20:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: AcadEntity</title>
      <link>https://forums.autodesk.com/t5/net-forum/acadentity/m-p/10149055#M17282</link>
      <description>&lt;P&gt;Sorry, I'm not wholly familiar with the terminology as using the AutoCAD SDK is my first actual dive into AutoCAD in general, but I'll explain the best I can. I have block references like the following in the document:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dpesinQPT9M_0-1615482748895.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/891933i87DB30261D68CDAB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dpesinQPT9M_0-1615482748895.png" alt="dpesinQPT9M_0-1615482748895.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to be able to extract the text from it along with each individual component. I think that&amp;nbsp; fits more with your description of attribute values that are unique within each block reference.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Mar 2021 17:14:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/acadentity/m-p/10149055#M17282</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-11T17:14:15Z</dc:date>
    </item>
  </channel>
</rss>

