Since there is no document on this, can someone confirm this?
In Acad VBA, you can open/close drawings when a UserFrom is shown as modal
dialog, however, with .NET API, following call will cause "eNoDocument"
exception:
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.Open("[Path]\Drawing1.dwg");
I tried it in a button's Click event handler, in the Dialog box's Load event
handler, or even hide the dialog box first.
I did a few project using Palette or modeless dialog box, where I open
drawings when needed, without issue. I am a bit surprised when in my current
project the first time I want to open a drawing with a button on a modal
dialog box, as I often did in VBA before, and got the "eNoDocument"
exception.
I have the workaround for my project, just a bit surprised and want to make
sure this is true.