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) )
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
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.
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