//设置所有有图层颜色为黑色 BEGIN
AcDbDatabase * db;
//AcTransaction * tran;
db = acdbHostApplicationServices() -> workingDatabase();
//tran = db->transactionManager()->startTransaction();
AcDbLayerTable * pLayerTable;
AcDbLayerTableRecord *pLayerTblRcd;
AcDbLayerTableIterator *pLayerTableIterator;
db->getLayerTable(pLayerTable,AcDb::kForWrite);
pLayerTable->newIterator(pLayerTableIterator);
//char *pLayerName;
for(int i=1;!pLayerTableIterator->done();pLayerTableIterator->step(),i++){
pLayerTableIterator->getRecord(pLayerTblRcd,AcDb::kForWrite);
//pLayerTblRcd->getName(pLayerName);
AcCmColor color;
color.setRGB(0,0,0);
pLayerTblRcd->setColor(color);
pLayerTblRcd->close();
}
delete pLayerTableIterator;
pLayerTable->close();
//设置所有有图层颜色为黑色 END