Save and make read-only

Discussion in 'AutoCAD' started by Marcel Janmaat, Jan 27, 2005.

  1. Is it posible to save a drawing and make it read-only at the same time?

    M
     
    Marcel Janmaat, Jan 27, 2005
    #1
  2. Marcel Janmaat

    Jürg Menzi Guest

    Hi Marcel

    Use a Reactor and this function:
    Code:
    ;
    ; -- MeSetFileAtt
    ; Sets the file attributes.
    ; Arguments [Typ]:
    ;   Fil = Filename "C:\\Temp\\MyTemp\\Scrap.dwg" [STR]
    ;   Att = File attributes [INT]
    ;         - Attributes:
    ;            0 = Normal
    ;            1 = Read-only
    ;            2 = Hidden
    ;            4 = System
    ;           32 = Archiv
    ; Return [Typ]:
    ;   > True if suceed
    ; Notes:
    ;   - Requires ScrRun.dll (WinNT/9x only)
    ;
    (defun MeSetFileAtt (Fil Att / FilObj FilSys RetVal)
    (setq FilSys (vlax-create-object "Scripting.FileSystemObject")
    RetVal (cond
    ((= (vlax-invoke FilSys 'FileExists Fil) 0) nil)
    ((setq FilObj (vlax-invoke FilSys 'GetFile Fil))
    (vlax-Put FilObj 'Attributes Att)
    T
    )
    )
    )
    (if FilObj (vlax-release-object FilObj))
    (vlax-release-object FilSys)
    RetVal
    )
    
    Cheers
     
    Jürg Menzi, Jan 27, 2005
    #2
  3. Hello again Juerg,

    Thanks for the input..

    Again!

    Just took a peak at your site.
    Swiss german is not realy my prefered language.


    M
     
    Marcel Janmaat, Jan 27, 2005
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.