TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: andrew.. on January 19, 2021, 07:33:07 PM
-
Hello all
its been a while. happy new year to all.
I know the subject is a dumb question but I just thought there might be a clever way someone came up with to get this variable.
Is there a way to get a writestat of a dwg before it opens?
some of my coworkers want to just double click a file and have it open without any prompts whether its read only or not.
any guidance is appreciated
-
Not that I know of. Your coworkers should focus on more important stuff. :evil:
-
Maybe this:
(defun ALE_UtlFileWhoHas (PatNam / FilPtr TmpStr OutLst)
(if (and (findfile PatNam) (setq FilPtr (open (strcat (vl-filename-directory PatNam) "\\" (vl-filename-base PatNam) ".DWL") "r")))
(progn
(while (setq TmpStr (read-line FilPtr))
(setq OutLst (cons TmpStr OutLst))
)
(close FilPtr)
(reverse OutLst)
)
)
)
(defun LM:IsReadOnly ( f / fso file result )
(vl-load-com)
;; © Lee Mac 2010
(setq fso (vlax-create-object "Scripting.FileSystemObject"))
(setq result
(cond
( (zerop (vlax-invoke fso 'FileExists f)) nil )
( (= 1 (logand 1 (vlax-get (setq file (vlax-invoke fso 'GetFile f)) 'Attributes))) )
)
)
(and file (vlax-release-object file))
(vlax-release-object fso)
result
)