SetDisplayModeOverride - Color of object, c#


Are there any examples available for changing the display color (wire and shaded surface) of an object?

I think that the method I need to use is ObjectAttributes.SetDisplayModeOverride, is this correct?

Thanks in advance for your help.

In the object attributes, change the color source to object, then set the color. When working with an object retrieved from the document, call CommitChanges on the object.


A huge thanks - this works like a charm!


A quick question - I have implemented a method that controls the color of objects as based on your suggestion but I’m finding that the objects can cause a flickering effect at their edges when touching other objects of different color.

I think this must be due to something like a changing draw order?

Have you stumbled onto this problem before and if so have you found a way to prevent it from occurring?

A sincere thanks.

EDIT: The flicker seems to occur in ghosted views only.