对话框获得颜色
static int SelColor(){
////先获得当前层的ID
AcDbObjectId layerId = acdbHostApplicationServices()->workingDatabase()->clayer();
////然后获得当前层指针
AcDbLayerTableRecordPointer ptLayer(layerId,AcDb::OpenMode::kForRead);
////获得当前层的颜色
AcCmColor oldColor = ptLayer->color();
int nCurColor = oldColor.colorIndex();//当前层的颜色
int nNewColor = oldColor.colorIndex();//用户选择的颜色
if (acedSetColorDialog(nNewColor,Adesk::kFalse,nCurColor))
{
return nNewColor;
}
else
{
return nCurColor;
}
}
页:
[1]