Open dwg as read-only

Discussion in 'AutoCAD' started by Matt W, Aug 18, 2004.

  1. Matt W

    Matt W Guest

    With SDI set to 0, when I run the following, the drawing is opened as
    read-only....
    ThisDrawing.Application.Documents.Open "z:\mw\test.dwg", True

    With SDI set to 1, the help file says...
    When working in SDI mode, use the Open method from the Document object.
    ThisDrawing.Open "z:\mw\test.dwg"

    The drawing opens but not READ-ONLY.

    I'm sure it's something that I'm doing, or NOT doing... after all, it is
    getting late.

    My goal is to open the drawing as read-only when SDI is set to 1.


    Thanks in advance.
     
    Matt W, Aug 18, 2004
    #1
  2. Matt W

    Joe Sutphin Guest

    Application.Documents.Open "<Filename path", True

    Joe
     
    Joe Sutphin, Aug 19, 2004
    #2
  3. Matt W

    Matt W Guest

    Joe:
    It doesn't work. With SDI set to 1, I get a "Object doesn't support this
    property or method" error message.
    For what it's worth, I'm using 2005.

    --
    Matt W

    The difference between genius and stupidity is that genius has its limits.
    | Application.Documents.Open "<Filename path", True
    |
    | Joe
    | --
    |
    | | > With SDI set to 0, when I run the following, the drawing is opened as
    | > read-only....
    | > ThisDrawing.Application.Documents.Open "z:\mw\test.dwg", True
    | >
    | > With SDI set to 1, the help file says...
    | > When working in SDI mode, use the Open method from the Document object.
    | > ThisDrawing.Open "z:\mw\test.dwg"
    | >
    | > The drawing opens but not READ-ONLY.
    | >
    | > I'm sure it's something that I'm doing, or NOT doing... after all, it is
    | > getting late.
    | >
    | > My goal is to open the drawing as read-only when SDI is set to 1.
    | >
    | >
    | > Thanks in advance.
    | >
    | > --
    | > Matt W
    | >
    | > The difference between genius and stupidity is that genius has its
    limits.
    | >
    | >
    |
    |
     
    Matt W, Aug 19, 2004
    #3
  4. Matt W

    Matt W Guest

    Well, that's interesting...
    It didn't work the first time, but now it does. Maybe just a hiccup in the
    system??

    Anyhoo... It DOES work, BUT..... when it opens the drawing, it isn't
    read-only.
    Why is that?? And how do I MAKE it read-only?

    Thanks in advance!


    Matt W

    The difference between genius and stupidity is that genius has its limits.

    | Joe:
    | It doesn't work. With SDI set to 1, I get a "Object doesn't support this
    | property or method" error message.
    | For what it's worth, I'm using 2005.
    |
    | --
    | Matt W
    |
    | The difference between genius and stupidity is that genius has its limits.
    | | | Application.Documents.Open "<Filename path", True
    | |
    | | Joe
    | | --
    | |
    | | | | > With SDI set to 0, when I run the following, the drawing is opened as
    | | > read-only....
    | | > ThisDrawing.Application.Documents.Open "z:\mw\test.dwg", True
    | | >
    | | > With SDI set to 1, the help file says...
    | | > When working in SDI mode, use the Open method from the Document
    object.
    | | > ThisDrawing.Open "z:\mw\test.dwg"
    | | >
    | | > The drawing opens but not READ-ONLY.
    | | >
    | | > I'm sure it's something that I'm doing, or NOT doing... after all, it
    is
    | | > getting late.
    | | >
    | | > My goal is to open the drawing as read-only when SDI is set to 1.
    | | >
    | | >
    | | > Thanks in advance.
    | | >
    | | > --
    | | > Matt W
    | | >
    | | > The difference between genius and stupidity is that genius has its
    | limits.
    | | >
    | | >
    | |
    | |
    |
    |
     
    Matt W, Aug 19, 2004
    #4
  5. Matt,

    While in SDI, you are supposed to use the Open method from the Document
    object, not the Documents collection (according to the docs; that might be
    dated info). And the ReadOnly argument is not supported on the Document.Open
    method.

    So before you use the Open method, open the file for appending, then use the
    Open method, and close the file post-open.

    --
    R. Robert Bell


    Well, that's interesting...
    It didn't work the first time, but now it does. Maybe just a hiccup in the
    system??

    Anyhoo... It DOES work, BUT..... when it opens the drawing, it isn't
    read-only.
    Why is that?? And how do I MAKE it read-only?

    Thanks in advance!
     
    R. Robert Bell, Aug 19, 2004
    #5
  6. Matt W

    Matt W Guest

    Yeah... that's what I saw in the help file (*cough* "real men don''t read
    docs" *cough*)
    You lost me here. Mind elaborating on this one a bit?
     
    Matt W, Aug 19, 2004
    #6
  7. Sub Test()
    Dim myFileN As String
    myFileN = "C:\Temp\~17IT.dwg"
    Open myFileN For Append Lock Write As #1
    ThisDrawing.Open myFileN
    Close #1
    End Sub


    --
    R. Robert Bell


    Yeah... that's what I saw in the help file (*cough* "real men don''t read
    docs" *cough*)
    You lost me here. Mind elaborating on this one a bit?
     
    R. Robert Bell, Aug 19, 2004
    #7
  8. Matt W

    Matt W Guest

    Thanks, Robert!

    --
    Matt W

    The difference between genius and stupidity is that genius has its limits.
    | Sub Test()
    | Dim myFileN As String
    | myFileN = "C:\Temp\~17IT.dwg"
    | Open myFileN For Append Lock Write As #1
    | ThisDrawing.Open myFileN
    | Close #1
    | End Sub
    |
    |
    | --
    | R. Robert Bell
    |
    |
    | | Yeah... that's what I saw in the help file (*cough* "real men don''t read
    | docs" *cough*)
    |
    | > open the file for appending
    | You lost me here. Mind elaborating on this one a bit?
    |
    | --
    | Matt W
    |
    |
    |
     
    Matt W, Aug 20, 2004
    #8
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.