QQ登录

只需一步,快速开始

登录 | 注册 | 找回密码

三维网

 找回密码
 注册

QQ登录

只需一步,快速开始

展开

通知     

全站
8天前
查看: 2552|回复: 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);


. m0 M& Q- C, y" u( y6 t( ~$ J, W

// 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);

6 E6 v! t& x' @9 X( Y

if (es != Acad::eOk)

{

pBlockTable->close();

return;

}


! [1 E2 }. @7 o. [

pBlockTable->close();

        // create a new entity! s/ A6 [" J7 D/ h# J  h" |

AcDbCircle *pCircle =

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

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

5 s6 `6 y0 H& ~6 P$ o

// add the new entity to the model space

AcDbObjectId objId;

pBlockTableRec->appendAcDbEntity(objId, pCircle);

: y& h9 r# i, ^8 v# Z% Y

// close the entity

pCircle->close();

// close the model space block

pBlockTableRec->close();


* i6 j4 C# p: o2 E) I& ^) Z

// 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


+ X; R& T; v- r; N5 m9 s
发表回复
您需要登录后才可以回帖 登录 | 注册

本版积分规则


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

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

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