<?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: Entiy usage in separate thread. in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/entiy-usage-in-separate-thread/m-p/2859784#M62651</link>
    <description>&lt;P&gt;To my knowledge, you can not use the managed API from a separate thread (I think even if you are using COM, the calls to the AutoCAD COM interface would still execute under AutoCAD's thread).&amp;nbsp; It is for that reason that I have not played around with threading very much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I am mis-interpreting what you are trying to do, and you know for a fact that your separate thread will work, then I am pretty sure there is a mechanism for managing the thread and waiting for it to complete before returning, which would keep the ACAD UI unavailable to the user.&lt;/P&gt;</description>
    <pubDate>Fri, 17 Dec 2010 22:42:06 GMT</pubDate>
    <dc:creator>chiefbraincloud</dc:creator>
    <dc:date>2010-12-17T22:42:06Z</dc:date>
    <item>
      <title>Entiy usage in separate thread.</title>
      <link>https://forums.autodesk.com/t5/net-forum/entiy-usage-in-separate-thread/m-p/2856080#M62650</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Recently I faced with the following problem:&lt;/P&gt;&lt;P&gt;I want user to select some Entities and than perform with them some calculations. But calculations are time&amp;nbsp;consuming&amp;nbsp;and I decided to move them to separate thread. But when calculations are performed in background thread AutoCAD UI is available and user can edit/remove any of selected Entities.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The question: Is it possible to&lt;/P&gt;&lt;P&gt;1) Forbid user to edit drawing while calculation is performed, or . . .&lt;/P&gt;&lt;P&gt;2) Make drawing-independent copies of Entities, or . . .&amp;nbsp;&lt;/P&gt;&lt;P&gt;3) Continue calculations even if drawing was closed?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've already tried MdiActiveDocument.DocumentLock()&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.16667px;"&gt;and&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Entity.Clone() and tackle about&amp;nbsp;Entity.DeepClone() but still didn't find a solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for attention.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Dec 2010 23:32:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/entiy-usage-in-separate-thread/m-p/2856080#M62650</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-12-16T23:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: Entiy usage in separate thread.</title>
      <link>https://forums.autodesk.com/t5/net-forum/entiy-usage-in-separate-thread/m-p/2859784#M62651</link>
      <description>&lt;P&gt;To my knowledge, you can not use the managed API from a separate thread (I think even if you are using COM, the calls to the AutoCAD COM interface would still execute under AutoCAD's thread).&amp;nbsp; It is for that reason that I have not played around with threading very much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I am mis-interpreting what you are trying to do, and you know for a fact that your separate thread will work, then I am pretty sure there is a mechanism for managing the thread and waiting for it to complete before returning, which would keep the ACAD UI unavailable to the user.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Dec 2010 22:42:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/entiy-usage-in-separate-thread/m-p/2859784#M62651</guid>
      <dc:creator>chiefbraincloud</dc:creator>
      <dc:date>2010-12-17T22:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: Entiy usage in separate thread.</title>
      <link>https://forums.autodesk.com/t5/net-forum/entiy-usage-in-separate-thread/m-p/2859822#M62652</link>
      <description>&lt;P&gt;But I've did a lot of work, to move all calculations to a separate thread. Now I have 3 threads: 1) Acad main GUI thread 2) Calculation GUI thread 3) Calculation thread&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;During my calculations I don't need entire Entity, just its boundary representation and I do only Read operations. May be there is sense to create some drawing-independent wrappers around Entity and Brep?&lt;/P&gt;</description>
      <pubDate>Fri, 17 Dec 2010 23:22:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/entiy-usage-in-separate-thread/m-p/2859822#M62652</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-12-17T23:22:45Z</dc:date>
    </item>
  </channel>
</rss>

