One of the first things I learned doing Arx programming was that the Acad
block table could not be modified. Only the records it contains can be
(modelspace, paperspace). Thus, I never even attempted to open the block
table in write mode, dont know if you can (in Arx). However, most of the .Net
examples I have seen so far do exactly this. They dont attemp to modify the
block table, but they do open it in write mode, then go on to open the block
table records. In fact they pretty much open every table/record in write mode.
Is this the new (.Net) way of dealing with this?
Is there any harm in just opening everything for write, regardless if your
going to modify it or not?
In the same vein, I have to say I do feel kinda weird opening all these objects
(like when Im iterating through the blocktable) and then just leaving them and
waiting for the system to close them. Keep expecting some horrendous crash.
I do dispose() all my databases & transactions in which the table operations reside.
Another question, when starting a transaction against a database, whats the difference
between this code:
Database db = HostApplicationServices.WorkingDatabase;
using (Transaction t = db.TransactionManager.StartTransaction())
and this code?
Document doc = Application.DocumentManager.MdiActiveDocument;
using (Transaction t = doc.TransactionManager.StartTransaction())
The both appear to be using the current database.
Thanks for any insights
Perry