|
|
马上注册,结识高手,享用更多资源,轻松玩转三维网社区。
您需要 登录 才可以下载或查看,没有帐号?注册
x
// Function name : SetCurLayer( |8 |+ |7 d' l1 t4 ]4 c
// Description : 设置当前层
' }5 w/ A' E, e' Q, l// Return type : Acad::ErrorStatus1 m! S7 j6 | A+ j1 s+ Y' T& I( \; ^
// Argument : const char* lpLayerName
& J( S( b9 G% W0 ^// Argument : AcDbDatabase* pDb/* = NULL */
8 K/ Q( S( u/ I" q$ }/ d; zAcad::ErrorStatus SetCurLayer( const ACHAR * lpLayerName, AcDbDatabase * pDb /* = NULL */ )6 z( e. _! V' M: P# G: Z9 t
{
9 Z2 _" M: n/ N, Z( F. [AcDbDatabase * pCurDb = pDb;
% t1 p1 q; M8 _8 s( Rif (pCurDb == NULL)! s5 L, h. P! ~, Z, r4 E
pCurDb = acdbHostApplicationServices() -> workingDatabase();8 L0 v* `4 |6 W- u
AcDbLayerTableRecordPointer spRecord( lpLayerName , pCurDb, AcDb::kForRead);
+ `& r- l! j! @- H1 TAcad::ErrorStatus es = spRecord.openStatus();0 q& ^: W0 E2 C2 y
if (es == Acad::eOk)0 o$ X* _$ S# ?2 u2 l
{
4 _5 k; S5 J, B5 `: ies = pCurDb -> setClayer(spRecord -> objectId());1 z( I& p1 J7 l) Q: u; n: U- d
}' C; A' H! W1 d+ [/ O
return es;8 c+ ~8 Q0 r& x8 j6 u, S3 @3 |
}1 V0 A, w$ N3 V7 Y) S
转自:http://www.colinchou.com/archives/239
; t$ E8 k0 w+ j6 s! h N) J3 K# t: w' ^) D+ i
2 @. ~. c5 ?& p
http://www.3dportal.cn/discuz/source/plugin/sina_xweibo_x3/xwb/images/bgimg/icon_logo.png 该贴已经同步到 colinzhoucn的微博 |
|