Look at the AcDbSortentsTable class in the documentation.
thanks a lot, and the code below works well.
AcDbObjectIdArray idArr;
if (!CSelectionGet::SSGetFromDWG(idArr,_T(""),NULL,true))
{
return;
}
AcDbBlockTableRecord *pBtr = NULL;
if (Acad::eOk != acdbOpenObject(pBtr, Acad_System::GetBlockId(ACDB_MODEL_SPACE), AcDb::kForRead))
{
return;
}
AcDbSortentsTable *drawOrder = NULL;
pBtr->getSortentsTable(drawOrder, AcDb::kForWrite, Adesk::kTrue);
pBtr->close();
if (drawOrder)
{
drawOrder->moveToTop(idArr);
drawOrder->close();
}