When I do it, then my code looks something like this:
public void Initialize() {
Document doc = cad.DocumentManager.MdiActiveDocument;
if (null == doc)
return;
Database db = doc.Database;
Editor ed = doc.Editor;
using (doc.LockDocument()) {
using (Transaction tr = db.TransactionManager.StartTransaction()) {
ed.WriteMessage("\nThe \"{0}\" assembly successfully loaded.\n",
this.GetType().Assembly.Location);
// TODO: Here is my code of working with Database...
tr.Commit();
}
}
}
Assembly can be registered for autoloading (through the registry record or BUNDLE engine). I hadn't problems with such approach, but I remember - Alexander Rivilis wrote he had. He wrote what the Document (or Database) can be initialized not completely at the time of operation of this code. Ok, how can I check initialization of these objects was finished?
P.S. The "Spell Chek" button in the edition mode doesn't work, I see an empty window.