天气与日历 切换到窄版

 找回密码
 立即注册
中国膜结构网
十大进口膜材评选 十大国产膜材评选 十大膜结构设计评选 十大膜结构公司评选
查看: 135|回复: 0

长事务

[复制链接]
  • TA的每日心情
    开心
    7 小时前
  • 签到天数: 20 天

    [LV.4]偶尔看看III

    115

    主题

    11

    回帖

    1393

    积分

    管理员

    积分
    1393
    QQ
    发表于 2024-5-4 18:43:15 | 显示全部楼层 |阅读模式
    1. static void zffObjectARX采用MyCommand14(void)
    2. {
    3. // Add your code for command zffObjectARX.采用MyCommand14 here
    4. ACHAR* fileName;
    5. AcDbDatabase* pDb;
    6. AcDbObjectId transId;
    7. struct resbuf* filename;
    8. filename=acutNewRb(RTSTR);
    9. acedGetFileD(采用T("请选择要检出的图"),NULL,采用T("dwg"),0,filename);
    10. pDb=new AcDbDatabase(Adesk::kFalse);
    11. fileName=filename->resval.rstring;
    12. pDb->readDwgFile(fileName);
    13. AcDbBlockTable *pBlk=NULL;
    14. AcDbBlockTableRecord *pBlkRcd=NULL;
    15. pDb->getSymbolTable(pBlk,AcDb::kForRead);
    16. pBlk->getAt(ACDB采用MODEL采用SPACE,pBlkRcd,AcDb::kForRead);
    17. pBlk->close();
    18. AcDbObjectIdArray objIds;
    19. AcDbBlockTableRecordIterator* it=NULL;
    20. pBlkRcd->newIterator(it);
    21. pBlkRcd->close();
    22. AcDbEntity* pEnt=NULL;
    23. for (it->start();!it->done();it->step())
    24. {
    25. it->getEntity(pEnt,AcDb::kForRead);
    26. if (pEnt->isKindOf(AcDbCircle::desc()))
    27. {
    28. objIds.append(pEnt->objectId());
    29. }
    30. }
    31. pEnt->close();
    32. delete it;
    33. AcDbBlockTable* pBlkCur=NULL;
    34. AcDbBlockTableRecord* pBlkRcdCur=NULL;
    35. acdbHostApplicationServices()->workingDatabase()->getSymbolTable(pBlkCur,AcDb::kForRead);
    36. pBlkCur->getAt(ACDB采用MODEL采用SPACE,pBlkRcdCur,AcDb::kForWrite);
    37. pBlkCur->close();
    38. AcDbObjectId objIdCur=pBlkRcdCur->objectId();
    39. pBlkRcdCur->close();
    40. AcDbIdMapping p;
    41. acapLongTransactionManagerPtr()->checkOut(transId,objIds,objIdCur,p);
    42. //AcDbObject* pObj=NULL;
    43. AcDbLongTransaction* pLongTrans;
    44. if (acdbOpenObject(pLongTrans,transId,AcDb::kForWrite)==Acad::eOk)
    45. {
    46. //AcDbLongTransaction* pLongTrans=AcDbLongTransaction::cast(pObj);
    47. AcDbLongTransWorkSetIterator* pItor=NULL;
    48. pLongTrans->newWorkSetIterator(pItor);
    49. int index;
    50. acedGetInt(采用T("\n输入要改变的颜色值:"),&index);
    51. for (pItor->start();!pItor->done();pItor->step())
    52. {
    53. AcDbEntity* pEnt1=NULL;
    54. acdbOpenObject(pEnt1,pItor->objectId(),AcDb::kForWrite);
    55. pEnt1->setColorIndex(index);
    56. pEnt1->close();
    57. }
    58. delete pItor;
    59. ACHAR str[20]={0};
    60. acedGetString(0,采用T("\n观察实体的改变,按回车结束!"),str);
    61. pLongTrans->close();
    62. }
    63. acapLongTransactionManagerPtr()->checkIn(transId,p);
    64. pDb->saveAs(fileName);
    65. acutRelRb(filename);
    66. delete pDb;
    67. pDb=NULL;
    68. }
    复制代码

     

     

     

     

    长事务
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    QQ|Archiver|中国膜结构网|中国膜结构协会|进口膜材|国产膜材|ETFE|PVDF|PTFE|设计|施工|安装|车棚|看台|污水池|中国膜结构网_中国空间膜结构协会

    GMT+8, 2024-11-5 12:30 , Processed in 0.129040 second(s), 26 queries .

    Powered by Discuz! X3.5

    © 2001-2024 Discuz! Team.

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