找回密码
 立即注册

QQ登录

只需一步,快速开始

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

如何拷贝将一个AcDbDatabase拷贝到另一张dwg里面

[复制链接]

0

主题

0

回帖

26

积分

管理员

积分
26
发表于 2024-9-25 13:29:37 | 显示全部楼层 |阅读模式
  1. Acad::ErrorStatus insert(
  2.     const AcGeMatrix3d& xform,
  3.     AcDbDatabase* pDb,
  4.     bool preserveSourceDatabase = true
  5. );
  6. Parameters
  7. Parameters  Description  
  8. const AcGeMatrix3d& xform  Input transformation matrix applied to all objects being inserted  
  9. AcDbDatabase* pDb  Input pointer to database to insert from  
  10. bool preserveSourceDatabase = true  Input to determine whether the source database pDb will be left intact  
  11. Description
  12. Inserts the Model Space of the database pointed to by pDb into the Model Space of the database invoking the insert() function. All objects being inserted have the xform matrix passed into their transformBy() function during the insertion process.
  13. The preserveSourceDatabase argument determines whether the source database pDb is left intact or not. The default value of the argument is true. In that case, objects from the source database are copied to the destination database and the source database is not changed. If the caller passes false for this argument, objects from the source database could be physically moved into the destination database. The latter runs faster, but it leaves the source database dependent on the destination database. The caller should make sure that the source database is deleted either immediately or at least before the destination database is deleted.
  14. When preserveSourceDatabase is false, the deep clone context will be AcDb::kInsert during the cloning that occurs during AcDbDatabase::insert(). When preserveSourceDatabase is true, the deep clone context will be AcDb::kInsertCopy during the cloning that occurs during AcDbDatabase::insert().
  15. Returns Acad::eOk if operation is successful.
  16. 代码如下:
  17.           将pFromDataSrc拷贝到pToDataDes;
  18.          AcDbDatabase *pFromDataSrc;
  19.           AcDbDatabase *pToDataDes;
  20.         pToDataDes->insert(AcGeMatrix3d::kIdentity,pFromDataSrc);
复制代码
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2024-12-27 22:15 , Processed in 0.154819 second(s), 19 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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