|
|
马上注册,结识高手,享用更多资源,轻松玩转三维网社区。
您需要 登录 才可以下载或查看,没有帐号?注册
x
// Function name : SetCurLayer
# N$ @% P) v8 t1 m// Description : 设置当前层$ Q: q* A' K; a; ?4 f1 @# j
// Return type : Acad::ErrorStatus! O" D8 f7 x5 I
// Argument : const char* lpLayerName2 U1 \9 N/ L& u: p
// Argument : AcDbDatabase* pDb/* = NULL */) Y: l! p0 r8 ~- T% P
Acad::ErrorStatus SetCurLayer( const ACHAR * lpLayerName, AcDbDatabase * pDb /* = NULL */ )
% x" E" B1 i# u! G3 S f: |( M$ y9 b{
+ h% }- D" i6 [5 {# EAcDbDatabase * pCurDb = pDb;0 g3 j; P# W0 ]! l
if (pCurDb == NULL)
* x% n, b/ {. o* |pCurDb = acdbHostApplicationServices() -> workingDatabase();
% N3 |1 m; c) f9 g( Q ` aAcDbLayerTableRecordPointer spRecord( lpLayerName , pCurDb, AcDb::kForRead);- ?- \4 n# f, P5 Z, t
Acad::ErrorStatus es = spRecord.openStatus();
; `1 x4 Y+ A1 b: V0 [if (es == Acad::eOk)9 z6 W5 b' _8 ^( |
{
2 K, F3 e1 n+ e4 m6 C( T! Yes = pCurDb -> setClayer(spRecord -> objectId());0 P. A. E, j8 c2 F
}+ `! r& f) q- k2 ~4 ~4 N- J
return es;
$ {" E$ \' d, i+ `- h7 n: D0 |" U}
% K% `3 v/ N' J0 [" r9 q' s 转自:http://www.colinchou.com/archives/2395 m3 D. y% V3 u9 |2 Z+ R+ u
+ V: m& i8 o& O
- _7 d7 a# h" B http://www.3dportal.cn/discuz/source/plugin/sina_xweibo_x3/xwb/images/bgimg/icon_logo.png 该贴已经同步到 colinzhoucn的微博 |
|