
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, I have the following block of code in myPlugin.cs in IExtensionApplication.Initialize() method...
object oldCmdEcho = Application.GetSystemVariable("CMDECHO");
object oldFileDia = Application.GetSystemVariable("FILEDIA");
Application.SetSystemVariable("CMDECHO", 0);
Application.SetSystemVariable("FILEDIA", 0);
Document doc = Application.DocumentManager.MdiActiveDocument;
doc.SendStringToExecute(
"_.cuiload "
+ "MyCui.cuix"
+ " ",
false, false, false
);
Application.SetSystemVariable("FILEDIA", oldFileDia);
Application.SetSystemVariable("CMDECHO", oldCmdEcho);
(Assuming MyCui.cuix already exists)
It's fine if I load this managed dll via "netload" command (after the document is loaded)
But it seems there is a problem if I try to load this using demand load (auto-load at AutoCad startup)
It seems like DocumentManager.MdiActiveDocument gets called before the document is fully loaded.
This code gives me eNoDocument exception.
Anybody else have had the same issue?
Is there other approaches to auto-load the custom cuix?
Thank you for your help always.
Solved! Go to Solution.