Limitations on Using AutoLISP in an MDI Environment

AutoCAD AutoLISP & Visual LISP

 
Limitations on Using AutoLISP in an MDI Environment
 
 
 

When using native AutoLISP in an MDI environment, you can only work with one drawing document at a time. Although AutoLISP provides support for exchanging variables and exposing functions to multiple namespaces, you cannot, for example, run a function in one document namespace and issue entmake to create an entity in another document namespace. AutoLISP does not support accessing information across multiple drawings.

You can access multiple document namespaces using ActiveX automation, and AutoLISP provides access to ActiveX methods (see ). However, accessing multiple documents with ActiveX is an unsupported feature of AutoLISP. For example, an AutoLISP program running in the context of document A can change the active document to document B by calling vla-put-activedocument. Changing the active document, though, immediately suspends execution of the program. The program may resume execution if the user activates the window containing document A but the system will be in an unstable state and likely to fail.

WarningIf you do use ActiveX to work in MDI, be aware that if you close all AutoCAD drawings you lose access to AutoLISP and will cause an exception.