QQ登录

只需一步,快速开始

登录 | 注册 | 找回密码

三维网

 找回密码
 注册

QQ登录

只需一步,快速开始

展开

通知     

全站
10天前
查看: 2554|回复: 0
收起左侧

[原创] 【ObjectArx05】使用saveas保存dwg的方法

[复制链接]
发表于 2014-1-11 12:29:51 | 显示全部楼层 |阅读模式 来自: 中国江苏南京

马上注册,结识高手,享用更多资源,轻松玩转三维网社区。

您需要 登录 才可以下载或查看,没有帐号?注册

x

static void mySaveAs()

{

AcDbDatabase* pDb = new AcDbDatabase(Adesk::kFalse);

Acad::ErrorStatus es = pDb->readDwgFile(L"c:\\temp\\In.dwg");

assert(es == Acad::eOk);

: U& F0 F7 B; q

// get the block table

AcDbBlockTable *pBlockTable;

es = pDb->getBlockTable(pBlockTable,

AcDb::kForRead);

if (es != Acad::eOk)

{

return;

}

// get model space

AcDbBlockTableRecord *pBlockTableRec;

es = pBlockTable->

getAt(ACDB_MODEL_SPACE, pBlockTableRec,

AcDb::kForWrite);

' J3 M9 D- a  c- H3 k

if (es != Acad::eOk)

{

pBlockTable->close();

return;

}

. u0 b) M6 }" {0 n- L2 B

pBlockTable->close();

        // create a new entity
4 I* @9 B" ?& M  a+ A  a

AcDbCircle *pCircle =

new AcDbCircle(AcGePoint3d(0,0,0),

AcGeVector3d(0,0,1),100);


8 h8 Z4 U# `0 w/ k

// add the new entity to the model space

AcDbObjectId objId;

pBlockTableRec->appendAcDbEntity(objId, pCircle);

. i1 a  ~' t5 Q% `: s- t" d

// close the entity

pCircle->close();

// close the model space block

pBlockTableRec->close();

% e1 w4 Z. r# e- G  C

// save as to the new drawing

        es = pDb->saveAs(L"c:\\temp\\Out.dwg");

assert(es == Acad::eOk);

delete pDb;

}

转载自:http://www.colinchou.com/?p=308


& Z- v  m' ~6 E
发表回复
您需要登录后才可以回帖 登录 | 注册

本版积分规则


Licensed Copyright © 2016-2020 http://www.3dportal.cn/ All Rights Reserved 京 ICP备13008828号

小黑屋|手机版|Archiver|三维网 ( 京ICP备2023026364号-1 )

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