+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Full Member
    Computer Details
    WPerciful's Computer Details
    Operating System:
    Windows 7
    Discipline
    See details...
    WPerciful's Discipline Details
    Occupation
    Piping Designer
    Discipline
    See details below.
    Details
    Petro-Chem
    Using
    AutoCAD 2015
    Join Date
    Sep 2013
    Location
    Houston, TX
    Posts
    87

    Question saveas code not working

    Registered forum members do not see this ad.

    I'm not sure what happened but I can't seem to get this simple line of code to work.

    HTML Code:
    (command "_saveas" "2013" "D:\\Work\\Test.dwg")
    It just returns a nil.

    There is nothing wrong with the file path. If I enter the same data in at the command line it works fine.

  2. #2
    Full Member
    Computer Details
    WPerciful's Computer Details
    Operating System:
    Windows 7
    Discipline
    See details...
    WPerciful's Discipline Details
    Occupation
    Piping Designer
    Discipline
    See details below.
    Details
    Petro-Chem
    Using
    AutoCAD 2015
    Join Date
    Sep 2013
    Location
    Houston, TX
    Posts
    87

    Default

    For some reason it works on my work PC, but it fails on my laptop and my home PC.

    It would seem that there is there an intermittent problem.

  3. #3
    Full Member
    Computer Details
    WPerciful's Computer Details
    Operating System:
    Windows 7
    Discipline
    See details...
    WPerciful's Discipline Details
    Occupation
    Piping Designer
    Discipline
    See details below.
    Details
    Petro-Chem
    Using
    AutoCAD 2015
    Join Date
    Sep 2013
    Location
    Houston, TX
    Posts
    87

    Default

    Thanks to a post by: ElpanovEvgeniy found:

    http://forums.augi.com/showthread.ph...a-Lisp-Routine

    This seems to be the answer:

    Code:
    (vla-SaveAs (vla-get-ActiveDocument(vlax-get-acad-object)) filename ac2013_dwg)

    Last edited by WPerciful; 6th Feb 2015 at 03:48 am. Reason: code error

  4. #4
    Super Moderator rkmcswain's Avatar
    Computer Details
    rkmcswain's Computer Details
    Operating System:
    Windows 10
    Computer:
    HP Z240
    CPU:
    i7-7700k @ 4.20GHz
    RAM:
    64GB
    Graphics:
    Nvidia Quadro P1000
    Primary Storage:
    0.5TB SSD
    Secondary Storage:
    1TB SATA
    Monitor:
    Vizio 40"
    Discipline
    Civil
    Using
    Civil 3D 2019
    Join Date
    Sep 2005
    Location
    Houston
    Posts
    4,544

    Default

    Registered forum members do not see this ad.

    It works fine here using 2015.

    The only case where I can get it to fail is when:
    * You do not have write permissions
    * The filename provided already exists.

    See also: http://www.cadtutor.net/forum/showth...le-saveas-LISP
    Last edited by rkmcswain; 6th Feb 2015 at 01:49 pm. Reason: add link
    R.K. McSwain
    CAD Panacea | twitter

Similar Threads

  1. code transfered from VB2008 to VB 2010 no longer working
    By dbroada in forum .NET, ObjectARX & VBA
    Replies: 12
    Last Post: 27th Mar 2013, 03:58 pm
  2. Cond.. code is not working
    By bijoyvm in forum AutoLISP, Visual LISP & DCL
    Replies: 3
    Last Post: 27th May 2012, 12:43 pm
  3. Sa - saveas??
    By ILoveMadoka in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 4
    Last Post: 11th Apr 2011, 01:31 pm
  4. saveas- how to use?
    By muthu123 in forum AutoLISP, Visual LISP & DCL
    Replies: 3
    Last Post: 15th Jul 2010, 12:42 pm
  5. SaveAs New Name
    By chomuth in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 17th Feb 2010, 06:14 pm

Tags for this Thread

Bookmarks

Posting Permissions

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