0x01
需求:Revit背景黑白颜色变化
0x02
代码如下
Autodesk.Revit.ApplicationServices.Application application = commandData.Application.Application;
Color oldBackgroundColor = application.BackgroundColor;
Color newBackgroundColor;
if (oldBackgroundColor.Red == 0
&& oldBackgroundColor.Blue == 0
&& oldBackgroundColor.Green == 0)
{
newBackgroundColor = new Color(255, 255, 255);
}
else
{
newBackgroundColor = new Color(0, 0, 0);
}
application.BackgroundColor = newBackgroundColor;
return Result.Succeeded;