<?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: GetObject method of transaction class gives exception in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/getobject-method-of-transaction-class-gives-exception/m-p/10505141#M15670</link>
    <description>&lt;P&gt;ObjectId’s are reassigned everytime the drawing is loaded so you cannot save them off in this way. &amp;nbsp;Instead save the entity handle as it will persist across each session. &amp;nbsp;You can get the &amp;nbsp;objectId from the handle.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;SPAN&gt;long&lt;/SPAN&gt; ln = &lt;SPAN&gt;Convert&lt;/SPAN&gt;.ToInt64(handleAsString, 16);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;SPAN&gt;Handle&lt;/SPAN&gt; hn = &lt;SPAN&gt;new&lt;/SPAN&gt; &lt;SPAN&gt;Handle&lt;/SPAN&gt;(ln);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;SPAN&gt;ObjectId&lt;/SPAN&gt; id = db.GetObjectId(&lt;SPAN&gt;false&lt;/SPAN&gt;,hn,0);&lt;/P&gt;</description>
    <pubDate>Thu, 29 Jul 2021 12:14:06 GMT</pubDate>
    <dc:creator>Keith.Brown</dc:creator>
    <dc:date>2021-07-29T12:14:06Z</dc:date>
    <item>
      <title>GetObject method of transaction class gives exception</title>
      <link>https://forums.autodesk.com/t5/net-forum/getobject-method-of-transaction-class-gives-exception/m-p/10505120#M15669</link>
      <description>&lt;P&gt;1. Draw line.&lt;BR /&gt;2. Save objectId of line to file.&lt;/P&gt;&lt;P&gt;3. Close document.&lt;BR /&gt;4. Open document&lt;BR /&gt;5. Load ObjectId from file&lt;BR /&gt;6. Try to get line object by this objectId&lt;BR /&gt;7. Get System.AccessViolationException: "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;GetObject method of transaction class gives exception (that writed above) when I'm trying to access object after reopening drawing. That's all&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Entity ent = Transaction.GetObject(id, OpenMode.ForWrite) as Entity;&lt;/P&gt;&lt;P&gt;System.AccessViolationException: "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."&lt;/P&gt;&lt;P&gt;any idea why?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 12:06:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/getobject-method-of-transaction-class-gives-exception/m-p/10505120#M15669</guid>
      <dc:creator>eranUZA53</dc:creator>
      <dc:date>2021-07-29T12:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: GetObject method of transaction class gives exception</title>
      <link>https://forums.autodesk.com/t5/net-forum/getobject-method-of-transaction-class-gives-exception/m-p/10505141#M15670</link>
      <description>&lt;P&gt;ObjectId’s are reassigned everytime the drawing is loaded so you cannot save them off in this way. &amp;nbsp;Instead save the entity handle as it will persist across each session. &amp;nbsp;You can get the &amp;nbsp;objectId from the handle.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;SPAN&gt;long&lt;/SPAN&gt; ln = &lt;SPAN&gt;Convert&lt;/SPAN&gt;.ToInt64(handleAsString, 16);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;SPAN&gt;Handle&lt;/SPAN&gt; hn = &lt;SPAN&gt;new&lt;/SPAN&gt; &lt;SPAN&gt;Handle&lt;/SPAN&gt;(ln);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;SPAN&gt;ObjectId&lt;/SPAN&gt; id = db.GetObjectId(&lt;SPAN&gt;false&lt;/SPAN&gt;,hn,0);&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 12:14:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/getobject-method-of-transaction-class-gives-exception/m-p/10505141#M15670</guid>
      <dc:creator>Keith.Brown</dc:creator>
      <dc:date>2021-07-29T12:14:06Z</dc:date>
    </item>
  </channel>
</rss>

