Message 1 of 6
AutoCAD 2014. MdiActiveDocument return null.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I try get Active AutoCAD document inside handler of custom event which run when data updated on server. Inside this handler I try call CommandMethod by command name.
public static void API_DataUpdate(ServerKey arg1, ServerData arg2) { cmdName="TestCommand"; cmdName = cmdName.TrimEnd() + " "; document = AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument; document.SendStringToExecute(cmdName, true, false, true); }
But inside this handler MdiActiveDocument return null also DocumentCollection contains document in which I try run command, and also document is active inside AutoCAD. Why it's hapened ? Identical code with this handler perfectly works via AutoCAD 2015/2016.