i think that now you are supposed to use SaveAs method, you can check the backward compability (if you have the ARX downloaded and look for dbmain.h, for acdbSaveAs2000(), etc) those can be p-invoked, i tried that many moons ago, but no luck backthen... maybe (not tested, just grabbed from my old dwgConvert class), something like, in my case was a conversion from ADT to AutoCAD, see if you use the built-in +SAVEAS command, might work, do not recall if now it is a command line access and no need to do any Pinvoke:
const int RTNORM = 5100;
const int RTCAN = -5002;
const short RTSTR = 5005;
const string PrefixConvert = "CONVERTED-";
const string prefixAcad = "ACAD-";
const string prefixBackup = "BACKUP-";
[SuppressUnmanagedCodeSecurity]
[DllImport("acad.exe", CallingConvention = CallingConvention.Cdecl)]
extern static int acedCmd(IntPtr resbuf);
public void MySaveAsTest()
{
// save the drawing to a new one using exporttoautocad
// I need to use this approach - any other I tried did not work
// like SaveAs() or SaveDatabaseAs2000()
var resultBuffer = new ResultBuffer
{
new TypedValue(RTSTR, "_.-EXPORTTOAUTOCAD"),
new TypedValue(RTSTR, "_Format"),
new TypedValue(RTSTR, "2000"),
new TypedValue(RTSTR, "_Type"),
new TypedValue(RTSTR, "_Insert"),
new TypedValue(RTSTR, "_Prefix"),
new TypedValue(RTSTR, PrefixConvert),
new TypedValue(RTSTR, ""),
new TypedValue(RTSTR, "")
};
var status = acedCmd(resultBuffer.UnmanagedObject);
if (status == RTNORM || status == RTCAN)
{
//...
}
}
hth.-