AutoCAD locks what are readonly .dvbs

Discussion in 'AutoCAD' started by AKS, Sep 27, 2004.

  1. AKS

    AKS Guest

    We keep .dvbs on a network in a readonly directory. Even as such these files cannot be modified when loaded by someone and, since it seems that a dvb cannot unload itself, editing the dvbs while in use requires saving to a temporary dvb file. It there a way around this?
     
    AKS, Sep 27, 2004
    #1
  2. No unless you wait till everyone goes home.
    -- Mike
    ___________________________
    Mike Tuersley
    CADalyst's CAD Clinic
    Rand IMAGINiT Technologies
    ___________________________
    the trick is to realize that there is no spoon...
     
    Mike Tuersley, Sep 28, 2004
    #2
  3. AKS

    Matt W Guest

    The way I've gotten around this is to unload the app when it's done.

    ThisDrawing.SendCommand "_vbaunload" & vbCr & """Filename.dvb""" & vbCr


    Hope this helps.

    --
    I support two teams: the Red Sox and whoever beats the Yankees.


    | No unless you wait till everyone goes home.
    | -- Mike
    | ___________________________
    | Mike Tuersley
    | CADalyst's CAD Clinic
    | Rand IMAGINiT Technologies
    | ___________________________
    | the trick is to realize that there is no spoon...
     
    Matt W, Sep 28, 2004
    #3
  4. AKS

    Tim Riley Guest

    You could just use Application.UnloadDVB "Filename.dvb" instead.

    ~Tim Riley
     
    Tim Riley, Sep 28, 2004
    #4
  5. AKS

    AKS Guest

    I've tried these before without success, but I see now that
    they only work hen "filename.dvb"is "fullpath/filename.dvb".

    The Application.UnloadDVB works buts generates
    an "execution error" message. The SendCommand method
    does not generate an error message. I've used these as the
    last line in the userform terminate event.

    Thanks
     
    AKS, Sep 28, 2004
    #5
  6. Whether you unload or not, its still not a fix because you have no control
    over someone accessing the file while you're in it. The only safe way is to
    work on a copy of the dvb.

    -- Mike
    ___________________________
    Mike Tuersley
    CADalyst's CAD Clinic
    Rand IMAGINiT Technologies
    ___________________________
    the trick is to realize that there is no spoon...
     
    Mike Tuersley, Sep 28, 2004
    #6
  7. AKS

    Matt W Guest

    What I've done with other "critical" files is to create an INI file on the
    network and the user's hard drive.
    Every time AutoCAD starts up, both INI files are checked. If one section of
    the user's INI file does not match the same section of the INI file on the
    network, the "critical" file on the user's hard drive is deleted, the one
    from the network is downloaded to the user's HD, then the INI file on the
    user's HD is updated to match the one on the network.

    Works like a charm every time!

    --
    I support two teams: the Red Sox and whoever beats the Yankees.


    | Whether you unload or not, its still not a fix because you have no control
    | over someone accessing the file while you're in it. The only safe way is
    to
    | work on a copy of the dvb.
    |
    | -- Mike
    | ___________________________
    | Mike Tuersley
    | CADalyst's CAD Clinic
    | Rand IMAGINiT Technologies
    | ___________________________
    | the trick is to realize that there is no spoon...
     
    Matt W, Sep 28, 2004
    #7
  8. Nice approach Matt!

    -- Mike
    ___________________________
    Mike Tuersley
    CADalyst's CAD Clinic
    Rand IMAGINiT Technologies
    ___________________________
    the trick is to realize that there is no spoon...
     
    Mike Tuersley, Sep 29, 2004
    #8
  9. AKS

    Matt W Guest

    Thanks.
    I use DosLib to read/write the INI files.
    DosLib makes it really easy, and like I said, it works EVERY time! :)

    --
    I support two teams: the Red Sox and whoever beats the Yankees.


    | Nice approach Matt!
    |
    | -- Mike
    | ___________________________
    | Mike Tuersley
    | CADalyst's CAD Clinic
    | Rand IMAGINiT Technologies
    | ___________________________
    | the trick is to realize that there is no spoon...
     
    Matt W, Sep 29, 2004
    #9
  10. AKS

    AKS Guest

    I think the auto-unload would work most of the time. The VBA's are usually modal forms and so they would be unloaded when dismissed. The downside is a slightly longer load time. The auto-unload could be removed once the VBA is past the point where a tweek is unlikely.

    Is there a way for the VBA to know its fullpath name? The unload command requires the fullpath name. I want to avoid hardcoding the fullpath name.
     
    AKS, Sep 29, 2004
    #10
  11. AKS

    Matt W Guest

    Here you go...

    Debug.Print Application.VBE.ActiveVBProject.FileName

    --
    I support two teams: the Red Sox and whoever beats the Yankees.


    |I think the auto-unload would work most of the time. The VBA's are usually
    modal forms and so they would be unloaded when dismissed. The downside is a
    slightly longer load time. The auto-unload could be removed once the VBA is
    past the point where a tweek is unlikely.
    |
    | Is there a way for the VBA to know its fullpath name? The unload command
    requires the fullpath name. I want to avoid hardcoding the fullpath name.
     
    Matt W, Sep 29, 2004
    #11
  12. AKS

    AKS Guest

    Thanks Matt. I use the Object Browser as a guide to see what is available. That item is not listed.
     
    AKS, Oct 1, 2004
    #12
  13. Add a reference to "Microsoft Visual Basic for Applications Extensibility 5.3"
    Regards - Nathan
     
    Nathan Taylor, Oct 5, 2004
    #13
  14. AKS

    Davids Guest

     
    Davids, Oct 8, 2004
    #14
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.