verify if dwg was saved

Discussion in 'AutoCAD' started by Hunter van Leeuwen, Mar 30, 2005.

  1. Hello,

    -I have a lisp that verifies whether a dwg was saved but it doesn't seem to
    work quite right. When you save it should warn by a pop up dialogue box if
    the dwg wasn't saved, see lisp below.

    -When saving this is what happens with no errors, well there is an error but
    not the way I expected.

    ----------------------cut---------------------cut---------------------cut---------------------
    Command: SS
    ..save Save drawing as <G:\05148\A-ELEV1.dwg>: A drawing with this name
    already
    exists.
    Do you want to replace it? <N> y Unable to save to drawing
    G:\05148\A-ELEV1.dwg
    as it is being accessed by another session.
    Drawing saved to G:\05148\sav1BC.tmp
    ----------------------------------------------------------------------------------------------

    lisp
    ----------------------------------------------------------------------------------------------
    (DEFUN C:ss ()
    (SETQ DN(GETVAR "DWGNAME"))
    (SETQ DP(GETVAR "DWGPREFIX"))
    (SETQ B(STRCAT Dp DN))
    (command ".save" "" "y")
    (SETQ SN(GETVAR"SAVENAME"))
    (setq xc(WCMATCH B SN))
    (IF(= xc nil)(blad)))

    "blad" is just a dialogue box pop up that says not saved (eye catching)"
    ----------------------cut---------------------cut---------------------cut---------------------
    Can someone offer some suggestions please.
    Thank you,
    Hunter
     
    Hunter van Leeuwen, Mar 30, 2005
    #1
  2. Hunter van Leeuwen

    Jim Claypool Guest

    Use (command ".qsave")
     
    Jim Claypool, Mar 30, 2005
    #2
  3. Jim,

    Well.....thank you!

    Hunter

     
    Hunter van Leeuwen, Mar 30, 2005
    #3
  4. This points out a beef I have with AutoCAD over the various methods of
    saving, that apparently a lot of people aren't aware of.

    The toolbar and pull-down menu items that say "Save" are misleading, because
    they are in fact NOT the actual SAVE command -- they're the QSAVE command.
    That just updates the contents of the drawing file you're in, and you
    wouldn't need the "yes" answer in there for that.

    The SAVE command makes a drawing file SEPARATE from the one you're in, but
    leaves you working in your original drawing, so if you use the same name and
    choose to overwrite it, you're trying to overwrite the drawing you're in,
    which of course it can't let you do.

    The SAVEAS command (as in most other Windows programs) makes a drawing file
    separate from the one you're in, AND leaves you working in that new drawing
    instead of the one in which you invoked the command.
    --
    Kent Cooper


    .....
     
    Kent Cooper, AIA, Mar 30, 2005
    #4
  5. Hunter van Leeuwen

    James Allen Guest

    Thank you Kent! Somehow SAVE had eluded me. And even when I had looked for
    just that, for customization.

    But this revives a question I've had; is there a SAVE (per Kent's
    explanation) method available for programming (w/o command), anyone?

    IOW:
    command qsave = doc.save
    command save = <what goes here?>
    command saveas = doc.saveas
     
    James Allen, Mar 30, 2005
    #5
  6. Look into the functions:

    vla-save
    vla-saveas
     
    Luis Esquivel, Mar 30, 2005
    #6
  7. If you mean you want to use these AutoCAD commands without using the
    (command) lisp function, there's always the plain old macro menu item
    approach, or a script. [I don't still have the original post, or I'd offer
    a macro or script equivalent to the lisp line there, if the rest of it can
    also be done without the (command) function.]
     
    Kent Cooper, AIA, Mar 30, 2005
    #7
  8. Hunter van Leeuwen

    James Allen Guest

    Thank you Luis. Yes, those are what I mentioned (just stated in vba terms;
    sorry).
    But (referring back to Kent's description) neither of those ...

    .... makes a drawing file SEPARATE from the one you're in, but
    leaves you working in your original drawing...

    AFAIK.

    That's what I'm looking for, but without using any form of "command".
    I don't *think* it's there, but I wouldn't mind being wrong.

    James
     
    James Allen, Mar 30, 2005
    #8
  9. Hunter van Leeuwen

    James Allen Guest

    No, I mean for direct use in lisp or vba.

    Thanks,

    James
     
    James Allen, Mar 30, 2005
    #9
  10. Let me see if I understood now.... if not please ignore me...

    When I want to have a separate file, I use vla-save to have the latest
    changes made and vl-file-copy or just the later.

    LE.
     
    Luis Esquivel, Mar 30, 2005
    #10
  11. Hunter van Leeuwen

    James Allen Guest

    Yes, almost exactly. The only difference is whether the current file is
    updated. Vla-save and then vl-file-copy saves the current file and makes a
    new file. Command SAVE makes the new file without altering the current
    file.

    James
     
    James Allen, Mar 31, 2005
    #11
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.