Message 1 of 4
Help using AddDocumentWindow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello.
I have been experimenting with the AddDocumentWindow API to insert a custom HTML window in AutoCAD 2016. The method is super easy to use and it works great. A new document window is created and the chromium engine does a find job of handling the HTML.
However I am finding that AutoCAD hangs when I go to close the application after creating one of these windows. If the window is closed before exiting then everything is good but if the window is still open then it becomes a problem.
Does anyone have any insight into this problem? Any possible workarounds that I might try to get around the issue? Thanks for any help.
-Chris
[Autodesk.AutoCAD.Runtime.CommandMethod("DOCWIN")]
public void DocWin()
{
string title = "DocWin";
string url = "http://www.autodesk.com/";
// Don't do anything if the doc window already exists.
foreach (Autodesk.AutoCAD.Windows.DocumentWindow dw in AcadApplication.DocumentWindowCollection)
{
if (dw.Title.Equals(title))
return;
}
Autodesk.AutoCAD.Windows.DocumentWindow newdw = AcadApplication.DocumentWindowCollection.AddDocumentWindow(title, new System.Uri(url));
}