Results 1 to 7 of 7

Thread: Use Saveas Command from a Lisp Routine

  1. #1
    I could stop if I wanted to
    Join Date
    2015-09
    Posts
    420
    Login to Give a bone
    0

    Default Use Saveas Command from a Lisp Routine

    Hello AUGI Members:

    Is there a way to envoke the SaveAs command from inside a lisp routine and still get the Save Drawing As dialog box to select the folder and drawing name of the new file. When I attempt to do this I only get the command line prompt and I would like to have the ability to interactively select the target folder and file name.

    Thank you for any assistance in this matter.....!!!!

    Regards,
    Vince

  2. #2
    AUGI Addict madcadder's Avatar
    Join Date
    2000-11
    Location
    Too far from the beach
    Posts
    1,054
    Login to Give a bone
    0

    Default Re: Use Saveas Command from a Lisp Routine

    Code:
    (DEFUN c:sas ()
      (COMMAND "_saveas" "" "~")
      (PRINC "\nSaveAs Complete:")
      (PRINC)
    ) ;_ end of DEFUN

  3. #3
    I could stop if I wanted to
    Join Date
    2015-09
    Posts
    420
    Login to Give a bone
    0

    Default Re: Use Saveas Command from a Lisp Routine

    Tod:

    Thank you for your quick response.......your code seems to be working exactly the way I need it to accomplish my objective.

    Thanks again for your help....!!!

    Regards,
    Vince

  4. #4
    AUGI Addict madcadder's Avatar
    Join Date
    2000-11
    Location
    Too far from the beach
    Posts
    1,054
    Login to Give a bone
    0

    Default Re: Use Saveas Command from a Lisp Routine

    Nadda problem... Have a good one.

  5. #5
    Active Member ElpanovEvgeniy's Avatar
    Join Date
    2006-09
    Location
    Russia, Moscow
    Posts
    54
    Login to Give a bone
    0

    Default Re: Use Saveas Command from a Lisp Routine

    Code:
    (vla-SaveAs (vla-get-ActiveDocument(vlax-get-acad-object)) "d:\\test_1.dwg" ac2004_dwg)
    last argument - format file:
    Code:
    acR14_dwg
    ac2000_dwg
    ac2000_dxf
    ac2000_Template
    ac2004_dwg
    ac2004_dxf
    ac2004_Template
    ac2007_dwg
    ac2007_dxf
    ac2007_Template
    acNative

  6. #6
    Member
    Join Date
    2005-10
    Location
    InnerSpace
    Posts
    12
    Login to Give a bone
    0

    Default Re: Use Saveas Command from a Lisp Routine

    (command "saveas" "2000" "" "_Y")


    saves to the 2000 format

  7. #7
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,805
    Login to Give a bone
    0

    Cool Re: Use Saveas Command from a Lisp Routine

    Quote Originally Posted by madcadder View Post
    Code:
    (DEFUN c:sas ()
      (COMMAND "_saveas" "" "~")
      (PRINC "\nSaveAs Complete:")
      (PRINC)
    ) ;_ end of DEFUN
    If you pick an existing file (with the intent of overwriting it), and the file happens to be read-only (or the user otherwise does not have write access) - then nothing happens and the user will get a misleading "SaveAs Complete"
    R.K. McSwain | CAD Panacea |

Similar Threads

  1. opening a .dwg OR .dwt file AND saveas with a lisp routine
    By mmccollum661679 in forum AutoLISP
    Replies: 2
    Last Post: 2012-08-24, 01:21 PM
  2. Add layer command line to a lisp routine
    By BrianTFC in forum AutoLISP
    Replies: 1
    Last Post: 2012-02-02, 07:47 AM
  3. LISP routine for Area Command
    By Mac Demer in forum AutoCAD General
    Replies: 12
    Last Post: 2010-07-14, 06:24 PM
  4. Replies: 14
    Last Post: 2007-09-03, 08:01 PM
  5. BURST command in Lisp Routine
    By mhollar in forum AutoLISP
    Replies: 6
    Last Post: 2005-12-19, 11:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •