Object ARX 统一设置所有图层的RGB颜色

//设置所有有图层颜色为黑色 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

猜你喜欢

转载自www.cnblogs.com/mjgw/p/12509803.html