well i liked redefining the open command to always open read-only, but then I wanted to have it prompt for the next line (the drawing path and filename) to open that drawing read only. I modified it a bit to say:
Code:
(vl-load-com)
(if (zerop (getvar "SDI"))
(vlax-invoke-method
(vla-get-documents (vlax-get-acad-object))
'Open
(getstring "")
:vlax-true
)
)
That hangs up because the automatically generated list produces file names in quotes.
then I tried
Code:
(vl-load-com)
(command "._undefine" "open")
(defun C:open ()
(if (zerop (getvar "SDI"))
(vlax-invoke-method
(vla-get-documents (vlax-get-acad-object))
'Open
(getstring "")
:vlax-true
)
)
)
which works kinda, but then it returns to the host drawing (Drawing1) to run the script instead of the drawing it opened read-only...
I'm confused as well... this batch script generator (Hurricane) doesn't seem to like my methods of trying to open things read-only. I can load the lisp into AutoCAD to redefine the OPEN command, but then it doesnt accept the filename in quotes.
Maybe it can't be done this way and I am best off just putting the program on a user that has read-only access to drawings and then running the program from there. That way the script will open all the drawings up read-only as well as use the batch script generator correctly unless you can think of a way to modify the lisp. Thanks for all your effort though.