static void zffObjectARX_MyCommand6(void)
{
AcDbObjectId secondId;
AcDbObjectId minutId;
AcDbObjectId HourId;
AcDbEntity* pSecond=NULL;
AcDbEntity* pMinute=NULL;
AcDbEntity* pHour=NULL;
AcDbHandle haSecond(_T("209"));
AcDbHandle haMinut(_T("1FC"));
AcDbHandle haHour(_T("1FB"));
AcDbDatabase* pDb=acdbHostApplicationServices()->workingDatabase();
pDb->getAcDbObjectId(secondId,false,haSecond);
pDb->getAcDbObjectId(minutId,false,haMinut);
pDb->getAcDbObjectId(HourId,false,haHour);
double ang=pi()/30;
AcGeMatrix3d rotate,minut,hour;
rotate.setToRotation(-ang,AcGeVector3d::kZAxis,AcGePoint3d(100,100,0));
minut.setToRotation(-ang/60,AcGeVector3d::kZAxis,AcGePoint3d(100,100,0));
hour.setToRotation(-ang/720,AcGeVector3d::kZAxis,AcGePoint3d(100,100,0));
while (1)
{
clock_t start=clock();
clock_t time=CLOCKS_PER_SEC;
while (clock()-start<time)
;
acdbOpenObject(pSecond,secondId,AcDb::kForWrite);
acdbOpenObject(pMinute,minutId,AcDb::kForWrite);
acdbOpenObject(pHour,HourId,AcDb::kForWrite);
pSecond->transformBy(rotate);
pMinute->transformBy(minut);
pHour->transformBy(hour);
pSecond->close();
pMinute->close();
pHour->close();
pSecond=NULL;
pMinute=NULL;
pHour=NULL;
actrTransactionManager->queueForGraphicsFlush();
actrTransactionManager->flushGraphics();
acedUpdateDisplay();
}
}