明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1626|回复: 0

高人来看看,CAD2006中奇怪的反应器问题!

[复制链接]
发表于 2007-11-29 16:15:00 | 显示全部楼层 |阅读模式
在CAD2006中增加数据库反应器后,绘制一个实体,如:line
我此时只做了新增实体的操作,但是CAD命令行却做了很多的反应(贴出一部分),望高人解答啊:
AutoCAD2006:
  1. Event: AcDbDatabaseReactor::objectModified
  2. ,实体类型:AcDbDimStyleTableRecord,对象句柄:F2,ObjectID:7EF5EF90,图形数据库:7EF5B
  3. 428
  4. Entity Count = 0
  5. Event: AcDbDatabaseReactor::object(Un)Erased
  6. ,实体类型:AcDbDimStyleTableRecord,对象句柄:F2,ObjectID:7EF5EF90,图形数据库:7EF5B
  7. 428
  8. Entity Count = 1
  9. Event: AcDbDatabaseReactor::objectModified
  10. ,实体类型:AcDbLinetypeTableRecord,对象句柄:F4,ObjectID:7EF5EFA0,图形数据库:7EF5B
  11. 428
  12. Entity Count = 1
  13. Event: AcDbDatabaseReactor::object(Un)Erased
  14. ,实体类型:AcDbLinetypeTableRecord,对象句柄:F4,ObjectID:7EF5EFA0,图形数据库:7EF5B
  15. 428
  16. Entity Count = 2
  17. ps:CAD2006中Entity Count 的值也不对,添加一条直线后为5
AUTOCAD2004:
Command: l LINE Specify first point:
Specify next point or [Undo]:  Event: AcDbDatabaseReactor::objectAppended
,实体类型:AcDbLine,对象句柄:82,ObjectID:7EF50E90,图形数据库:7EF35C28
Entity Count = 1
Event: AcDbDatabaseReactor::objectModified
,实体类型:AcDbLine,对象句柄:82,ObjectID:7EF50E90,图形数据库:7EF35C28
Entity Count = 1
Event: AcDbDatabaseReactor::objectModified
,实体类型:AcDbBlockTableRecord,对象句柄:1F,ObjectID:7EF50CF8,图形数据库:7EF35C28
Entity Count = 1
  1. PS:在CAD2004中Entity Count值是正确的。
复制代码
  1. 下面是主要方法的源代码: 
复制代码
  1. //打印Object信息
  2. void printObj(const AcDbObject* pObj)
  3. {
  4. AcDbHandle hObj;
  5. TCHAR szBuffer[10];
  6. if (pObj == NULL)
  7. {
  8.   acutPrintf("(NULL)");
  9. }
  10. pObj->getAcDbHandle(hObj);
  11. hObj.getIntoAsciiBuffer(szBuffer);
  12. acutPrintf("实体类型:%s,对象句柄:%s,ObjectID:%lx,图形数据库:%lx\n",
  13.   pObj->isA()->name(),szBuffer,pObj->objectId().asOldId(),pObj->database());
  14. }////
  15. //打印Event信息
  16. void printEvent(const AcDbObject* pObj,LPCSTR szEvent)  
  17. {
  18. acutPrintf(" Event: AcDbDatabaseReactor::%s ,",szEvent);
  19. }
  20. void CDBRector::objectAppended(const AcDbDatabase* dwg, const AcDbObject* dbObj)
  21. {
  22. printEvent(dbObj,TEXT("objectAppended"));
  23. printObj(dbObj);
  24. iEntNum++;
  25. acutPrintf("Entity Count = %d\n",iEntNum);
  26. }
  27. void CDBRector::objectModified(const AcDbDatabase* dwg, const AcDbObject* dbObj)
  28. {
  29. printEvent(dbObj,TEXT("objectModified"));
  30. printObj(dbObj);
  31. acutPrintf("Entity Count = %d\n",iEntNum);
  32. }
  33. void CDBRector::objectErased(const AcDbDatabase* dwg,const AcDbObject* dbObj,Adesk::Boolean bErased)
  34. {
  35. if (bErased)
  36. {
  37.   iEntNum--;
  38.   printEvent(dbObj,TEXT("objectErased"));
  39.   printObj(dbObj);
  40. }
  41. else
  42. {
  43.   iEntNum++;
  44.   printEvent(dbObj,TEXT("object(Un)Erased"));
  45.   printObj(dbObj);
  46. }
  47. acutPrintf("Entity Count = %d\n",iEntNum);
  48. }
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-25 18:40 , Processed in 0.151988 second(s), 22 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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