You may want to update the "Last saved by" and "Revision number" properties and other custom properties associated with the drawing. The AcDbDatabaseSummaryInfo class of the ObjectARX SDK will help do that. The equivalent of this class in the AutoCAD .Net API is the "DatabaseSummaryInfo" structure. But unlike the C++ API, some of the properties such as "LastSavedBy" and "RevisionNumber" are read-only in .Net. You can also use the COM API to retrieve and set the properties. This is especially useful if you are driving AutoCAD from an external application or using VBA.
After the "Last saved by" property is changed, it is important to save the database using a different name. If not, the AutoCAD's save command will automatically use the system login name and set the "Last saved by" property.
Here is the ObjectARX C++ code snippet to set the "Last saved by" and "Revision number" properties while retrieving the other properties.
Acad::ErrorStatus es;
AcDbDatabaseSummaryInfo *pInfo;
AcDbDatabase *pCurDb = NULL;
ACHAR* info;
ACHAR* key;
ACHAR* value;
int customQty;
int index;
pCurDb = acdbHostApplicationServices()->workingDatabase();
// Get a pointer to the workingDatabase()
// summary information
es = acdbGetSummaryInfo(pCurDb, pInfo);
acutPrintf(L"\\nSummary information for this drawing:" );
es = pInfo->getTitle(info);
if (info)
{
acutPrintf(L"\\nTitle = %s" , info);
}
es = pInfo->getSubject(info);
if (info)
{
acutPrintf(L"\\nSubject matter = %s" , info);
}
es = pInfo->getAuthor(info);
if (info)
{
acutPrintf(L"\\nAutor = %s" , info);
}
es = pInfo->getKeywords(info);
if (info)
{
acutPrintf(L"\\nKeywords = %s" , info);
}
es = pInfo->getComments(info);
if (info)
{
acutPrintf(L"\\nComments = %s" , info);
}
es = pInfo->setLastSavedBy(L"Captain CAD" );
es = pInfo->getLastSavedBy(info);
acutPrintf(L"\\nLast saved by = %s" , info);
es = pInfo->getHyperlinkBase(info);
if (info)
{
acutPrintf(L"\\nLink Location = %s" , info);
}
es = pInfo->setRevisionNumber(L"1" );
es = pInfo->getRevisionNumber(info);
acutPrintf(L"\\nRevision number = %s" , info);
customQty = pInfo->numCustomInfo();
if (customQty > 0)
{
acutPrintf(L"\\nCustom Summary Information:\\n" );
acutPrintf(L"\\nKey\\t\\tValue\\n" );
for (index = 0; index < customQty; index++)
{
pInfo->getCustomSummaryInfo(index, key, value);
if (key)
{
acutPrintf(L"\\n%s" , key);
}
if (value)
{
acutPrintf(L"\\t\\t%s" , value);
}
acdbFree(key);
acdbFree(value);
}
}
else
{
acutPrintf(L"\\n\\nDrawing does not contain
any Custom SummaryInformation");
}
es = acdbPutSummaryInfo(pInfo);
acdbFree(info);
pCurDb->saveAs(ACRX_T("D:\\\\Temp\\\\MyTestArx.dwg" ));
To set the properties using COM API, here is a code snippet :
oAcadApp.ActiveDocument.Database.SummaryInfo.LastSavedBy = "Autodesk"
MsgBox(oAcadApp.ActiveDocument.Database.SummaryInfo.LastSavedBy)
oAcadApp.ActiveDocument.SaveAs("D:\\Temp\\MyTest.dwg" )