savas lisp for 2005

Discussion in 'AutoCAD' started by rojren, Sep 10, 2004.

  1. rojren

    rojren Guest

    I would appreciate it if any of you very nice people could tell me how to get this to work in R2005. The compatibility analyzer says the dwgname variable is different, but since I have no idea what I'm doing, it doesn't help me much....

    (defun C:xport2 (/ d_directory curr_dwgname d_dwgname)
    (setq d_directory "C:\\a-storage\\")
    (setq curr_dwgname (getvar "dwgname")
    d_dwgname (substr curr_dwgname
    1
    (- (strlen curr_dwgname) 4)
    )
    )
    (command "_saveas"
    "2000"
    (strcat d_directory d_dwgname)
    )
    (princ)
    )
     
    rojren, Sep 10, 2004
    #1
  2. rojren

    dblaha Guest

    It should work in r2005 just as it is. I quick test on my system showed no problem.

    Dave
     
    dblaha, Sep 10, 2004
    #2
  3. rojren

    dblaha Guest

    After a few more moments of reflection, I would guess that the compatibility analyzer got confused because you use the system variable name within two of the variable names in your routine.


    Dave
     
    dblaha, Sep 10, 2004
    #3
  4. rojren

    rojren Guest

    Well, when I try it I get:

    Command: xport2

    Invalid option keyword.
    ; error: Function cancelled
    Current file format: AutoCAD 2004 Drawing
    Enter file format [2000(LT2000)/2004/Standards/DXF/Template] <2004>:
    Save drawing as <H:\My Documents\Drawing14.dwg>: *Cancel*

    It works fine in Acad 2002 (with the addition of a "v" before the "2002" and with the "2002" changed to "r14", in the command string. And why would it go to "H:\My Documents"? I never save CAD files there. 'Makes my brain hurt.
     
    rojren, Sep 10, 2004
    #4
  5. rojren

    dblaha Guest

    I can't seem to duplicate that error using the code you posted. Are you certain you are using the code exactly as you posted it? I copied and pasted it directly onto my command line, created a folder on my C: called "a-storage" and ran it without a problem.
    AutoCAD wants to save to your "My Documents" folder because that is the default file-saving location stored in Windows. AutoCAD will default to it unless you open a file from another location or unless you specify a different location in the "Start In" field in the properties of the shortcut you use to start AutoCAD.

    Dave
     
    dblaha, Sep 10, 2004
    #5
  6. rojren

    Jim Claypool Guest

    I tried it in Map 3D 2005 and it works fine.
     
    Jim Claypool, Sep 10, 2004
    #6
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.