OpenDCL and Multi-Document Compatibility

Started by JAT, November 23, 2009, 03:17:12 PM

Previous topic - Next topic

JAT

The reason for the question is that since it is LISP that is running this, switching to another drawing file would "pull out the rug from under it" unless the appropriate LISP code has also been loaded into that drawing's memory area.  If the OpenDCL modules themselves are .ARX files, that can be handled through the ACAD.RX and it is a one-time shot for a particular drawing session.  The issue may become a factor when running LISP in multiple drawings within the same drawing session.  Also, what happens to these forms and dialog boxes that are running with LISP when the drawing is closed and AutoCAD is in the "no drawing open" mode?  Are they automatically closed?  Currently, we have an old VB application that interfaces with AutoCAD using the SendKeys, of all methods.  Since it is external to AutoCAD, it will "survive" across multiple drawings.  The issue with this application is that the .DLL's are probably going to be incompatible with the new Windows 7 system, and I don't have the source code for this program.  As a result, I immediately thought of using the OpenDCL.

BazzaCAD

#1
Hi Jorge, welcome to the team.

Yes this can be done.
You can use a Palette or modeless form. Like you said, you'll have to make sure you code is loaded when a DWG is opened. The easiest way to do this is to add it to something like "acaddoc.lsp"
You can also look into the "OnDocActivated" and "OnEnteringNoDocState" event to handle this. Maybe Fred can post some example code.
I wouldn't use the acad.rx file as it wont know what .arx to load e.g. 16, 17, or 18 or 32 vs. 64 bit.

Hope this helps.
a.k.a.
Barry Ralphs
barryDOTralphsATgmailDOTcom

owenwengerd

As you surmise, OpenDCL lives in the application context, so it works fine in the zero-document state. It's up to the implementor of a modeless form to decide how it should behave when entering zero-doc state, but the safest way to handle it is to just close the form. Otherwise, as Barry mentioned, you hgave to ensure that the implementation code loads again when a drawing is opened, and that no events fire while there is no document open.
Owen Wengerd (Outside The Box) / ManuSoft