autocadcadautolisp

Autolisp - Hide "Open As Read Only" Dialog Box


I'm trying to open up several drawings at the same time, run code on these drawings (skip if read only), and then close the files. The problem I'm running into is that if I open a file that is write protected, the following dialog box appears and stops the code. Is there a function or command to open files without having this dialog box appearing? An enable/disable capability?

Read Only Dialog Box

The cad application I'm using is DraftSight.


Solution

  • There is a tricky method. ( thanks @LeeMac)

    (setq ans(vl-catch-all-apply 'vl-file-rename (list path path )))
    

    If returns nil it means file is locked.