#RTCEUR Wish 2: Override graphics by Element

Increasing the complexity a bit from the previous post, this sample shows how to Override Graphics by Element. In this case, the cut & project line weight and color are overridden in the active view for the specified elements.

public void overrideElements()
    Document doc = this.ActiveUIDocument.Document;
    OverrideGraphicSettings ogs = new OverrideGraphicSettings();
    ogs.SetCutLineColor(new Color(0,255,0));
    ogs.SetProjectionLineColor(new Color(0,0,255));
    using (Transaction t = new Transaction(doc,"Overrides"))
        foreach (ElementId id in getIds(doc))
            doc.ActiveView.SetElementOverrides(id, ogs);

One thought on “#RTCEUR Wish 2: Override graphics by Element

  1. I think that the more interesting appraoch would be to be able to reset the override per element or make a selection based upon elements that have an override per element because this is the lowest for of override you can’t manage it anywhere.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s