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

posted @ 2020-03-17 12:12  中国膜结构网mjgou  阅读(320)  评论(0编辑  收藏  举报