找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
查看: 143|回复: 0

按表走呵呵!(延时死循环)

[复制链接]

1

主题

0

回帖

37

积分

管理员

积分
37
发表于 2024-5-4 18:43:42 | 显示全部楼层 |阅读模式
  1. static void zffObjectARX采用MyCommand6(void)
  2. {
  3. AcDbObjectId secondId;
  4. AcDbObjectId minutId;
  5. AcDbObjectId HourId;
  6. AcDbEntity* pSecond=NULL;
  7. AcDbEntity* pMinute=NULL;
  8. AcDbEntity* pHour=NULL;
  9. AcDbHandle haSecond(采用T("209"));
  10. AcDbHandle haMinut(采用T("1FC"));
  11. AcDbHandle haHour(采用T("1FB"));
  12. AcDbDatabase* pDb=acdbHostApplicationServices()->workingDatabase();
  13. pDb->getAcDbObjectId(secondId,false,haSecond);
  14. pDb->getAcDbObjectId(minutId,false,haMinut);
  15. pDb->getAcDbObjectId(HourId,false,haHour);
  16. double ang=pi()/30;
  17. AcGeMatrix3d rotate,minut,hour;
  18. rotate.setToRotation(-ang,AcGeVector3d::kZAxis,AcGePoint3d(100,100,0));
  19. minut.setToRotation(-ang/60,AcGeVector3d::kZAxis,AcGePoint3d(100,100,0));
  20. hour.setToRotation(-ang/720,AcGeVector3d::kZAxis,AcGePoint3d(100,100,0));
  21. while (1)
  22. {
  23. clock采用t start=clock();
  24. clock采用t time=CLOCKS采用PER采用SEC;
  25. while (clock()-start<time)
  26. ;
  27. acdbOpenObject(pSecond,secondId,AcDb::kForWrite);
  28. acdbOpenObject(pMinute,minutId,AcDb::kForWrite);
  29. acdbOpenObject(pHour,HourId,AcDb::kForWrite);
  30. pSecond->transformBy(rotate);
  31. pMinute->transformBy(minut);
  32. pHour->transformBy(hour);
  33. pSecond->close();
  34. pMinute->close();
  35. pHour->close();
  36. pSecond=NULL;
  37. pMinute=NULL;
  38. pHour=NULL;
  39. actrTransactionManager->queueForGraphicsFlush();
  40. actrTransactionManager->flushGraphics();
  41. acedUpdateDisplay();
  42. }
  43. }
复制代码
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|膜结构网

GMT+8, 2025-1-4 13:04 , Processed in 0.111463 second(s), 20 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表