- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I generally define the AutoCAD three as shown in my modules:
using acApp = Autodesk.AutoCAD.ApplicationServices.Application;
private Document doc;
private Database db;
private Editor ed;
private void InitializeAutoCAD()
{
doc = acApp.DocumentManager.MdiActiveDocument;
db = doc.Database;
ed = doc.Editor;
}
However, I have been writing some Entity Extensions, and was passing the AutoCAD database as an argument. But, I discovered that I could set the database via Entity.Database.
Which now has me thinking and looking, but couldn't find a way to get the Document (and consequently the Editor) from the Database nor the Entity.
What I would like to do is lock the document, without having to pass the doc as an argument. And, do Editor.WriteMessage in my catch, again without passing the argument.
Any one have a means to this end that will speed me along?
Solved! Go to Solution.