|
|
马上注册,结识高手,享用更多资源,轻松玩转三维网社区。
您需要 登录 才可以下载或查看,没有帐号?注册
x
// Function name : SetCurLayer
; h! n. i. l, a* k2 w// Description : 设置当前层" t4 O& _2 V4 Q ]
// Return type : Acad::ErrorStatus
# ^ z, K. r5 d7 v// Argument : const char* lpLayerName
7 [* p1 P0 `# ^0 O" ^1 r// Argument : AcDbDatabase* pDb/* = NULL */
2 s( y7 }- a2 y O) ?" N/ e' Q" c9 oAcad::ErrorStatus SetCurLayer( const ACHAR * lpLayerName, AcDbDatabase * pDb /* = NULL */ ) r; V; w. h3 t. x- I" H
{" @; n# B/ o+ G
AcDbDatabase * pCurDb = pDb;
; `* D7 d2 I& Y; W: mif (pCurDb == NULL)- F' l; S5 G3 D8 ^+ C
pCurDb = acdbHostApplicationServices() -> workingDatabase();% h+ H' {. h: U, `: x
AcDbLayerTableRecordPointer spRecord( lpLayerName , pCurDb, AcDb::kForRead);
2 y# L0 `1 ]0 C7 cAcad::ErrorStatus es = spRecord.openStatus();
. k& b9 q9 t( N2 |if (es == Acad::eOk)- s* h1 E$ ], S
{3 L* T9 g6 P! @7 Y0 `" `& S5 |# \% B
es = pCurDb -> setClayer(spRecord -> objectId());
" k/ F8 [! Y5 Q d! |+ S& {: [# Z}. w3 k8 Y) s! W1 P
return es;4 d# `9 L' H% i6 c# g/ \
}
! O, V; l3 D C, c" d 转自:http://www.colinchou.com/archives/239/ T' u9 W; _7 |- ?3 \1 J
9 l# h) n8 F7 ~, y0 F3 t: n' {/ Q V
http://www.3dportal.cn/discuz/source/plugin/sina_xweibo_x3/xwb/images/bgimg/icon_logo.png 该贴已经同步到 colinzhoucn的微博 |
|