按表走呵呵!(延时死循环)
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();
}
}
页:
[1]