ObjectARX, AutoCAD. Среда программирования библиотеки C++


         

This is called whenever an


acutPrintf("Entity Count = %d\n",
gpAsdkAppDocGlobals->entityCount());
}
// This is called whenever an object in the database is modified.
//
void
AsdkDbReactor::objectModified(const AcDbDatabase* db, const AcDbObject* pObj)
{
printDbEvent(pObj, "objectModified");
acutPrintf(" Db==%lx\n", (long) db);
}
// This is called whenever an object is erased from the database.
//
void
AsdkDbReactor::objectErased(const AcDbDatabase* db, const AcDbObject* pObj, Adesk::Boolean pErased)
{
if (pErased)
{
printDbEvent(pObj, "objectErased");
gpAsdkAppDocGlobals->decrementEntityCount();
                }
else
{
printDbEvent(pObj, "object(Un)erased");
gpAsdkAppDocGlobals->incrementEntityCount();
}
acutPrintf(" Db==%lx\n", (long) db);
acutPrintf("Entity Count = %d\n",
gpAsdkAppDocGlobals->entityCount());
}
// Prints the message passed in by pEvent; then
// proceeds to call printObj() to print the information about
// the object that triggered the notification.
//
void
printDbEvent(const AcDbObject* pObj, const char* pEvent)
{
acutPrintf(" Event: AcDbDatabaseReactor::%s ", pEvent);
printObj(pObj);
}
// Prints out the basic information about the object pointed
// to by pObj.
//
void
printObj(const AcDbObject* pObj)
{
if (pObj == NULL)
{
acutPrintf("(NULL)");
return;
}
AcDbHandle objHand;
char handbuf[17];
// Get the handle as a string.
//
pObj->getAcDbHandle(objHand);
objHand.getIntoAsciiBuffer(handbuf);
acutPrintf(
"\n (class==%s, handle==%s, id==%lx, db==%lx)",
pObj->isA()->name(), handbuf,
pObj->objectId().asOldId(), pObj->database());
}
// Document swapping functions
//
void
AsdkDocReactor::documentToBeActivated(AcApDocument *pDoc)
{
gpAsdkAppDocGlobals->setGlobals(pDoc);
}
void
AsdkDocReactor::documentCreated(AcApDocument *pDoc)
{
gpAsdkAppDocGlobals->setGlobals(pDoc);

Содержание  Назад  Вперед