Change background color to white with .net

Change background color to white with .net

ops.team
Explorer Explorer
484 Views
1 Reply
Message 1 of 2

Change background color to white with .net

ops.team
Explorer
Explorer

Hi, I searched everywhere and couldn't find a way

I want to change the background color of an AutoCAD drawing from black to white

I'm working with c#, visual  studio

Thanks!

 

0 Likes
485 Views
1 Reply
Reply (1)
Message 2 of 2

_gile
Consultant
Consultant

Hi

 

You can access this via the COM object AcadApplication.Preferences.Display.

You can avoid referencing the COM libraries by using the dynamic type (late bindings).

 

dynamic acadApp = Application.AcadApplication;
var displayPrefs = acadApp.Preferences.Display;
displayPrefs.GraphicsWinModelBackgrndColor = 255 << 16 | 255 << 8 | 255;    // white
displayPrefs.ModelCrosshairColor = 0;                                       // black


Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes