Lisp Routine to Save as Previous Version

In the company I work for we store our drawings in AutoCAD 2000 format due to the age and software on the majority of computers.  Since I do not want to lose some desirable features, the drawings I work with are AutoCAD 2010 format and I append -2010 to the drawing name to designate that.  When my work is done and it is time to make the drawings available to everyone, I have to save it in AutoCAD 2000 format. (I keep the -2010 files in another location for my future use.)

Though it is not difficult to do with the file save dialog box, I would prefer to write a lisp routine that gets the file name, strips off the -2010 and saves the file to AutoCAD 2000 format. I could then execute it with a tool button.  This is easy except that I cannot see a way to skip the dialog box.  I see that Qsave bypasses the dialog box but it will use the default drawing format (which I keep at 2010) and current file name.

Does anyone know of a way to save a drawing to a previous format without using a dialog box?

Comments

  • [code]
    (setvar 'filedia 0)
    (command "_.saveas" ...)
    ...
    ...
    (setvar 'filedia 1)
    [/code]
  • @Eric,

    Have you considered using _ETRANSMIT? This is really designed for this purpose, allowing you to convert to earlier file formats as part of the packaging process. Because you can point to a different destination, or zip, you could avoid having to append -2010 to the end of your filenames. You can make use of sheet sets (assuming you have V13) to batch process multiple drawing files. Alternatively you could use DWG TrueView, which is a free application that includes a feature called DWG Convert that allows you to do the same thing as eTransmit.

    If you want to use LISP, then the following code would change a filename from -2010 to -2000.
    [code](setq curdwgnm (getvar "dwgname")) ; find the current drawing name
    (setq curdwgnmlen (strlen curdwgnm)) ; find the num characters
    (setq newdwgnm (substr curdwgnm  1 (- curdwgnmlen 9))) ; create a new dwgname removing -2010.dwg
    (setq newdwgnm (strcat newdwgnm "-2000")) ; append -2000 to the new drawing name[/code]

    Regards,

    Jason Bourhill

    CAD Concepts

  • I want to thank both of you for your answers.  I should have thought of changing filedia. And changing "dwgname" to "savename" in Jason's code below makes the variable ready to use in the saveas command.   I have written a routine that does exactly what I want.  It will be a great time saver. 

    Thanks again.

This discussion has been closed.