<?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: How to use Database.Dxfin() in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/how-to-use-database-dxfin/m-p/3054386#M60566</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That looks much better. I would only suggest a missing MyDxfDb.Dispose after the routine to release the file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Augusto Goncalves&lt;/P&gt;
&lt;P&gt;Autodesk Developer Network&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jun 2011 12:59:15 GMT</pubDate>
    <dc:creator>augusto.goncalves</dc:creator>
    <dc:date>2011-06-10T12:59:15Z</dc:date>
    <item>
      <title>How to use Database.Dxfin()</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-use-database-dxfin/m-p/3052610#M60562</link>
      <description>&lt;P&gt;What is missing in the sample below (e.g. locking, closing, transactions) ?&lt;/P&gt;&lt;P&gt;The example below loads the dxf data but it doesn't show up in the Doc(after zoom all), until the document is saved and reopened.&lt;/P&gt;&lt;P&gt;Also AutoCAD crash if changed from Model to Paper: "Internal error: !dbsymblk.cpp@464:eWasOpenForWrite "&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[CommandMethod("myCmd")]&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void myCmd()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Document myDoc = Application.DocumentManager.MdiActiveDocument;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Database myDb = myDoc.Database;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Editor myEd = myDoc.Editor;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String dxfFilename = @"C:\temp\dxfSample.dxf";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String logFilename=@"c:\temp\dxfin.log";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myDb.DxfIn(dxfFilename, logFilename);&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; using (Transaction myTrans = myDb.TransactionManager.StartTransaction())&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BlockTable myBlocks = (BlockTable)myDb.BlockTableId.GetObject(OpenMode.ForRead);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BlockTableRecord myMS = (BlockTableRecord)&amp;nbsp;&amp;nbsp; myBlocks[BlockTableRecord.ModelSpace].GetObject(OpenMode.ForRead);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BlockTableRecordEnumerator btrEnum = myMS.GetEnumerator();&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; long nMsEnts = myMS.Cast&amp;lt;ObjectId&amp;gt;().Count();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myEd.WriteMessage("{0} ModelSpace Entities", nMsEnts);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myTrans.Commit();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2011 10:34:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-use-database-dxfin/m-p/3052610#M60562</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-06-09T10:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Database.Dxfin()</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-use-database-dxfin/m-p/3053554#M60563</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can see two immediately issues here:&lt;/P&gt;
&lt;P&gt;(1) Get the ActiveDocument and set a send file for it is not good. I would suggest you either call Application.DocumentManager.Open if you want yo open on scree, or create a new Database variable you want to read it 'in memory' (without show it on screen).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(2) You are using transactions, which is good, but in order to make this work you need to call myTrans.GetObject() instead calling directly entityId.GetObject(). This last approach is probably throwing a compile warning, right?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Augusto Goncalves&lt;/P&gt;
&lt;P&gt;Autodesk Developer Network&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2011 19:11:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-use-database-dxfin/m-p/3053554#M60563</guid>
      <dc:creator>augusto.goncalves</dc:creator>
      <dc:date>2011-06-09T19:11:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Database.Dxfin()</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-use-database-dxfin/m-p/3053588#M60564</link>
      <description>&lt;P&gt;Create a new Database and load with Dxfin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then on current Database use Insert passing in newly created database&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A target="_blank" href="http://www.theswamp.org/index.php?topic=37409.msg426596#msg426596"&gt;http://www.theswamp.org/index.php?topic=37409.msg426596#msg426596&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2011 19:28:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-use-database-dxfin/m-p/3053588#M60564</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-06-09T19:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Database.Dxfin()</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-use-database-dxfin/m-p/3054122#M60565</link>
      <description>&lt;P&gt;Thanks for your replies.&lt;/P&gt;&lt;P&gt;Insert a new database solved the issue and this solution is even the better one because the dxf entities need to be converted before inserting into the current drawing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;@Jeffrey: thanks for pointing me to TheSwamp solutions.&lt;/P&gt;&lt;P&gt;@Augusto﻿: i don't have compiler errors and the modelspace count result in the correct number. The only problem was nothing shown on screen. I liked the ent.GetObject method over the Transaction.GetObject because it shows me immediately where the objects comes from, the Transaction can be bound to anything. However i am going to use your suggestion from now on because i came across other problems using the ent.GetObject method. Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the working solution -- including a Zoom Extends.&lt;/P&gt;&lt;P&gt;﻿&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Document myDoc = Application.DocumentManager.MdiActiveDocument;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Database myDb = myDoc.Database;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Editor myEd = myDoc.Editor;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String dxfFilename = @"C:\temp\dxfSample.dxf";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String logFilename = @"c:\temp\dxfin.log";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; using (Transaction myTrans = myDb.TransactionManager.StartTransaction())&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Database myDxfDb = new Database(false, true);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myDxfDb.DxfIn(dxfFilename, logFilename);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Matrix3d dxfTrf = Matrix3d.Identity;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myDb.Insert(dxfTrf, myDxfDb, true);&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myDb.UpdateExt(true);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ViewTableRecord vTable = new ViewTableRecord();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Point3d minPoint = myDb.Extmin;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Point3d maxPoint = myDb.Extmax;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Point2d vMax = new Point2d(maxPoint.X, maxPoint.Y);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Point2d vMin = new Point2d(minPoint.X, minPoint.Y);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vTable.CenterPoint = vMin + 0.5 * (vMax - vMin);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vTable.Height = vMax.Y - vMin.Y;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vTable.Width = vMax.X - vMin.X;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myDoc.Editor.SetCurrentView(vTable);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myTrans.Commit();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2011 08:12:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-use-database-dxfin/m-p/3054122#M60565</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-06-10T08:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Database.Dxfin()</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-use-database-dxfin/m-p/3054386#M60566</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That looks much better. I would only suggest a missing MyDxfDb.Dispose after the routine to release the file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Augusto Goncalves&lt;/P&gt;
&lt;P&gt;Autodesk Developer Network&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2011 12:59:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-use-database-dxfin/m-p/3054386#M60566</guid>
      <dc:creator>augusto.goncalves</dc:creator>
      <dc:date>2011-06-10T12:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Database.Dxfin()</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-use-database-dxfin/m-p/3055280#M60567</link>
      <description>&lt;P&gt;MyDxfDb.Dispose﻿&lt;/P&gt;&lt;P&gt;Yes of course. Thanks for all the help to solve this part of the program.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2011 20:35:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-use-database-dxfin/m-p/3055280#M60567</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-06-10T20:35:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Database.Dxfin()</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-use-database-dxfin/m-p/3055624#M60568</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;&lt;P&gt;i came across other problems using the ent.GetObject method. Thanks!&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;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you give some examples of where ObjectId.GetObject() gave you problems. I have used it and not had problems and was wondering where it could cause problems.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Accoording to the docs ObjectId.GetObject will use the most recent transaction or the Top Tranction on the stack maintained by the TransactionManager.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Jun 2011 11:44:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-use-database-dxfin/m-p/3055624#M60568</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-06-11T11:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Database.Dxfin()</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-use-database-dxfin/m-p/3058026#M60569</link>
      <description>&lt;P&gt;The GetObject didn't gave me problems in this particular example. Unfortunately ﻿i can't remember where it was.&lt;/P&gt;&lt;P&gt;In this example the problems are in the database initialized ﻿in by AutoCAD itself. For newer DXF files we have to use&lt;/P&gt;&lt;P&gt;"new Database(false, true)"&lt;/P&gt;&lt;P&gt;I suppose the initial AutoCAD document is connected to a "new Database(TRUE, false)".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The second part of the first example beginning with "using (Transaction myTrans = ..."&lt;/P&gt;&lt;P&gt;had nothing to do with the DXFIN problem. It is counting the Modelspace entities and thus showing me that entities were actual added to my original document.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far i think whether you use Object.getObject or Transaction.getObject is merely a matter of taste&lt;/P&gt;&lt;P&gt;Coming from VB(6|A) i am used to call functions with the AcadDoc object which give me access to the Database, Entities&amp;nbsp; as well as the Document -- there are no transactions in VB.&lt;/P&gt;&lt;P&gt;It took me some time to find the relations between these objects iin c#&lt;/P&gt;&lt;P&gt;Document myDoc = Application.DocumentManager.MdiActiveDocument;﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Database myDb=myDoc.Database;﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Database myDb = HostApplicationServices.WorkingDatabase;﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Document myDoc=Application.DocumentManager.GetDocument(myDb);﻿ // may not exist&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Database myDb=myLine.Database;﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But now Transactions:&lt;/P&gt;&lt;P&gt;//from Transaction to Database&lt;/P&gt;&lt;P&gt;using (Transaction myTrans = myDb.TransactionManager.StartTransaction())﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Database myDb﻿=f(myTrans)????&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//from Database to Transaction&lt;/P&gt;&lt;P&gt;using (Transaction myTrans = myDb.TransactionManager.&lt;STRONG&gt;TopTransaction&lt;/STRONG&gt;)﻿&amp;nbsp; //may not exist&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So currently i can call my procedures with the Database object and then find the Document and Transaction objects.&lt;/P&gt;&lt;P&gt;And now the point of Augusto Goncalves﻿:&lt;/P&gt;&lt;P&gt;if no transaction exists for myDb&amp;nbsp; then the next line will result in a crash:&lt;/P&gt;&lt;P&gt;BlockTable myBlocks = (BlockTable)myDb2.BlockTableId.GetObject(OpenMode.ForRead);﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;@Jeffrey: ﻿I hope you understand what i am trying to say&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;&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2011 13:14:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-use-database-dxfin/m-p/3058026#M60569</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-06-14T13:14:17Z</dc:date>
    </item>
  </channel>
</rss>

