CAD FORUM - TIPS & TRICKS | UTILITIES | DISCUSSION | BLOCKS | SUPPORT | HELP & ASSISTANCE
Over 1.119.000 registered users (EN+CZ).
AutoCAD tips, Inventor tips, Revit tips, Civil tips, Fusion tips.
The new Beam calculator, Spirograph generator and Regression curves in the Converters section.
New AutoCAD 2027 commands and sys.variables
CAD tip # 2063:
Question
A
If you want to open a drawing (e.g. in LISP or in script) in a forced read-only (R/O) mode, you can use the following VLISP code:
(vl-load-com) (defun openRO (fn) (vla-activate (vla-open (vla-get-documents (vlax-get-acad-object)) fn :VLAX-TRUE)) )Then you can use e.g.:
(openRO "C:\\documents\\mydrawing.dwg")or
(openRO (getfiled "Open R/O" "" "DWG" 0))to open the drawing in ReadOnly mode (write-protected).
You can then also redefine the OPEN command to open all DWG files as read-only:
_UNDEFINE _OPEN (defun C:OPEN()(openRO (getfiled "Open R/O" "" "DWG" 0))(princ))and define a new command - "OPENEDIT" - to perform a "real" open:
(defun C:OPENEDIT()(command "._OPEN)(princ))
ACAD2010ACAD2008ACAD2004ACAD2000
26.3.2002
28452×
FAQ
this tip shared by ARKANCE experts applies to: AutoCAD 2010 · AutoCAD 2008 · AutoCAD 2004 · AutoCAD 2000 ·
![CAD Forum - ARKANCE Community - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz] CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz]](../common/arkance_186.png)

What is the ARKANCE Community?