Determines if AutoCAD runs in single- or multiple-document mode.
Supported platforms: Windows only
VBA:
object.SingleDocumentMode
Type: PreferencesSystem
The object this property applies to.
Read-only: No
Type: Boolean
The initial value for this property is False.
This property helps third-party developers update applications to work smoothly with the AutoCAD multiple-drawing mode. It may become obsolete in future releases of AutoCAD.
VBA:
Sub Example_SingleDocumentMode() ' This example reads and modifies the preference value that controls ' whether AutoCAD runs in single- or multiple-document mode. ' When finished, this example resets the preference value back to ' its original value. Dim ACADPref As AcadPreferencesSystem Dim originalValue As Variant, newValue As Variant ' Get the system preferences object Set ACADPref = ThisDrawing.Application.Preferences.System ' Read and display the original value originalValue = ACADPref.SingleDocumentMode MsgBox "The SingleDocumentMode preference is set to: " & originalValue ' Modify the SingleDocumentMode preference by toggling the value ACADPref.SingleDocumentMode = Not (ACADPref.SingleDocumentMode) newValue = ACADPref.SingleDocumentMode MsgBox "The SingleDocumentMode preference has been set to: " & newValue ' Reset the preference back to its original value ' ' * Note: Comment out this last section to leave the change to ' this preference in effect ACADPref.SingleDocumentMode = originalValue MsgBox "The SingleDocumentMode preference was reset back to: " & originalValue End Sub
Visual LISP:
(vl-load-com) (defun c:Example_SingleDocumentMode() ;; This example reads the preference value that lists ;; whether AutoCAD is running in single- or multiple-document mode. (setq acadObj (vlax-get-acad-object)) (setq preferences (vla-get-Preferences acadObj)) ;; Read the current value (setq currValue (vla-get-SingleDocumentMode (vla-get-System preferences))) (alert (strcat "The SingleDocumentMode preference is set to: " (if (= currValue :vlax-true) "True" "False"))) )