acedCommand(RTSTR, "wmfbkgnd", RTSHORT, 0, RTNONE);
AcDbDatabase* pDb = acdbHostApplicationServices()->workingDatabase();
const char* fname;
Acad::ErrorStatus es = pDb->getFilename(fname);
if (es == Acad::eOk)
{
CString szFileName(fname);
int nLastPos, nTmp = 0;
do
{
nLastPos = nTmp;
nTmp = szFileName.Find('.', nLastPos + 1);
} while (nTmp != -1);
if (nLastPos != -1)
{
szFileName = szFileName.Left(nLastPos) + ".wmf";
acedCommand(RTSTR, "qsave", RTNONE);
acedCommand(RTSTR, "_zoom", RTSTR, "_e", RTNONE);
acedCommand(RTSTR, "export", RTSTR, szFileName, RTSTR, "ALL", RTNONE);
acedCommand(RTSTR, "", RTNONE);
}
} |