对克隆实体的类型转换

AcDbEntity *pEnt;
acdbOpenAcDbEntity(pEnt, pId, AcDb::kForRead);

AcRxObject *pObj = NULL;
pObj = pEnt->clone();
AcDbEntity *pEntT = static_cast<AcDbEntity*>(pObj);

 

第二种

AcRxObject *obj = pPolyline->clone();

AcDbPolyline *newPoly = new AcDbPolyline();
newPoly =AcDbPolyline::cast(obj);

posted @ 2015-11-20 10:13  xzh1993  阅读(317)  评论(0编辑  收藏  举报