# Check for Overrides

**URL:** <https://forum.dynamobim.com/t/check-for-overrides/5576>\
**Category:** Revit\
**Tags:** revit, clockwork\
**Created:** [August 12, 2016, 2:45am UTC](https://forum.dynamobim.com/t/check-for-overrides/5576 "2016-08-12T02:45:47Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ewan\_Opie](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ewan_opie/32/77070_2.png) [@Ewan\_Opie](https://forum.dynamobim.com/u/Ewan_Opie)\
**Post date:** [August 12, 2016, 2:45am UTC](https://forum.dynamobim.com/t/check-for-overrides/5576/1 "2016-08-12T02:45:47Z")

</div>

Hi All,

Has anyone got a way to check if an element has been overridden in the Revit environment (Projection Lines, Cut Patterns etc.) and create a list of these elements.

I am looking to find out what has been ‘fudged’ by some less experienced staff.

Thanks for any help,  
Ewan

---

<div class="post-metadata">

**Author:** ![john\_pierson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/john_pierson/32/191977_2.png) [@john\_pierson](https://forum.dynamobim.com/u/john_pierson)\
**Post date:** [August 12, 2016, 2:48am UTC](https://forum.dynamobim.com/t/check-for-overrides/5576/2 "2016-08-12T02:48:19Z")

</div>

Overridden by element?

---

<div class="post-metadata">

**Author:** ![Ewan\_Opie](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ewan_opie/32/77070_2.png) [@Ewan\_Opie](https://forum.dynamobim.com/u/Ewan_Opie)\
**Post date:** [August 12, 2016, 3:00am UTC](https://forum.dynamobim.com/t/check-for-overrides/5576/3 "2016-08-12T03:00:58Z")

</div>

Example.  
A column in View 1 is concrete and has a cut pattern of Style 1 set by its material.  
But a staff member has changed the cut pattern to Style 2 in View 1.

Something like  
Element In-\>

No Override = 0  
Override exists = 1

Separate Outs-\>

---

<div class="post-metadata">

**Author:** ![john\_pierson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/john_pierson/32/191977_2.png) [@john\_pierson](https://forum.dynamobim.com/u/john_pierson)\
**Post date:** [August 12, 2016, 3:50am UTC](https://forum.dynamobim.com/t/check-for-overrides/5576/4 "2016-08-12T03:50:41Z")

</div>

Understood. But overridden individually or by category, or by view template?

I’m assuming individual, (element override).

---

<div class="post-metadata">

**Author:** ![john\_pierson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/john_pierson/32/191977_2.png) [@john\_pierson](https://forum.dynamobim.com/u/john_pierson)\
**Post date:** [August 12, 2016, 6:31pm UTC](https://forum.dynamobim.com/t/check-for-overrides/5576/5 "2016-08-12T18:31:04Z")

</div>

This figures out which elements are overridden for color in the current active view… I’m having a heck of a time making it work over multiple views.

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/2/27e0117c5d2d68fc23b0b3aa5ff3cbcb5858899c.png) The custom node (Element.IsColorOverridden) is from Rhythm, I will publish this node soon.

---

<div class="post-metadata">

**Author:** ![Einar\_Raknes](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/einar_raknes/32/8566_2.png) [@Einar\_Raknes](https://forum.dynamobim.com/u/Einar_Raknes)\
**Post date:** [August 12, 2016, 8:27pm UTC](https://forum.dynamobim.com/t/check-for-overrides/5576/6 "2016-08-12T20:27:32Z")

</div>

Something like this?

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/7/72c8cbf36133639521454507af9bab9d7cc0b33a.gif)  
##dynamo file  
[findOveriddenElements.dyn](https://forum.dynamobim.com/uploads/short-url/x4yRTX9FWZGG8b9aEiyTKGdtkw9.dyn) (6.3 KB)

##python script:

```
import clr

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

elements = UnwrapElement(IN[0])
view = UnwrapElement(IN[1])

OUT = []
for element in elements:
	o = view.GetElementOverrides(element.Id)
	OUT.append(
	not any([
	o.CutFillColor.IsValid, 
	o.CutFillPatternId > 0, 
	o.CutLineColor.IsValid, 
	o.CutLinePatternId > 0, 
	o.CutLineWeight > 0, 
	o.DetailLevel.ToString() != "Undefined",
	o.Halftone,	
	not(o.IsCutFillPatternVisible),
	not(o.IsProjectionFillPatternVisible), 
	o.ProjectionFillColor.IsValid, 
	o.ProjectionFillPatternId > 0, 
	o.ProjectionLineColor.IsValid, 
	o.ProjectionLinePatternId > 0, 
	o.ProjectionLineWeight > 0, 
	o.Transparency != 0
	])
	)
```

---

<div class="post-metadata">

**Author:** ![Ewan\_Opie](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ewan_opie/32/77070_2.png) [@Ewan\_Opie](https://forum.dynamobim.com/u/Ewan_Opie)\
**Post date:** [August 13, 2016, 2:19am UTC](https://forum.dynamobim.com/t/check-for-overrides/5576/7 "2016-08-13T02:19:22Z")

</div>

This is exactly what I was thinking. Legend!

---

<div class="post-metadata">

**Author:** ![Andre\_Almeida1](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@Andre\_Almeida1](https://forum.dynamobim.com/u/Andre_Almeida1)\
**Post date:** [October 18, 2016, 8:01pm UTC](https://forum.dynamobim.com/t/check-for-overrides/5576/8 "2016-10-18T20:01:02Z")

</div>

Possible with Linework overrides?

---

<div class="post-metadata">

**Author:** ![Ewan\_Opie](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ewan_opie/32/77070_2.png) [@Ewan\_Opie](https://forum.dynamobim.com/u/Ewan_Opie)\
**Post date:** [October 18, 2016, 8:25pm UTC](https://forum.dynamobim.com/t/check-for-overrides/5576/9 "2016-10-18T20:25:11Z")

</div>

In my current script it does not find the element if the line pattern is overridden, even though it appears to be listed in the python code ‘as pictured’ any ideas out there?

![](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/a/abbde7b8349e6c0f514a8461148dfe45a72acc6b.png)

[Find Elements that are Overridden in View.dyn](https://forum.dynamobim.com/uploads/short-url/qcII92osWZOj772gQen1GkvIzbP.dyn) (10.4 KB)

---

<div class="post-metadata">

**Author:** ![Einar\_Raknes](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/einar_raknes/32/8566_2.png) [@Einar\_Raknes](https://forum.dynamobim.com/u/Einar_Raknes)\
**Post date:** [October 18, 2016, 9:01pm UTC](https://forum.dynamobim.com/t/check-for-overrides/5576/10 "2016-10-18T21:01:35Z")

</div>

> [@Ewan\_Opie](#):
>
> In my current script it does not find the element if the line pattern is overridden

The only thing I can think of is that we are comparing ElementIds with integeres. The easiest way to fix this is to add .IntegerValue after all properties that ends with Id. like this:¨

```
o.CutLinePatternId.IntegerValue > 0

```

Try that and see if it works better, hope it does.

---

<div class="post-metadata">

**Author:** ![Ewan\_Opie](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ewan_opie/32/77070_2.png) [@Ewan\_Opie](https://forum.dynamobim.com/u/Ewan_Opie)\
**Post date:** [October 18, 2016, 9:51pm UTC](https://forum.dynamobim.com/t/check-for-overrides/5576/11 "2016-10-18T21:51:36Z")

</div>

Yep, this now allows the node to identify the overridden line pattern, good tip!

![](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/7/7b5147b433cfdffcf9459285f09e2ab053100358.png)

---

<div class="post-metadata">

**Author:** ![Einar\_Raknes](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/einar_raknes/32/8566_2.png) [@Einar\_Raknes](https://forum.dynamobim.com/u/Einar_Raknes)\
**Post date:** [October 19, 2016, 6:43am UTC](https://forum.dynamobim.com/t/check-for-overrides/5576/12 "2016-10-19T06:43:05Z")

</div>

Nice, here is the updated python code:

```
import clr

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

elements = UnwrapElement(IN[0])
view = UnwrapElement(IN[1])

OUT = []
for element in elements:
	o = view.GetElementOverrides(element.Id)
	OUT.append(
	not any([
	o.CutFillColor.IsValid, 
	o.CutFillPatternId.IntegerValue > 0, 
	o.CutLineColor.IsValid, 
	o.CutLinePatternId.IntegerValue > 0, 
	o.CutLineWeight > 0, 
	o.DetailLevel.ToString() != "Undefined",
	o.Halftone,	
	not(o.IsCutFillPatternVisible),
	not(o.IsProjectionFillPatternVisible), 
	o.ProjectionFillColor.IsValid, 
	o.ProjectionFillPatternId.IntegerValue > 0, 
	o.ProjectionLineColor.IsValid, 
	o.ProjectionLinePatternId.IntegerValue > 0, 
	o.ProjectionLineWeight > 0, 
	o.Transparency != 0
	])
	)
```

---

<div class="post-metadata">

**Author:** ![c.lipinski](https://avatars.discourse-cdn.com/v4/letter/c/7ba0ec/32.png) [@c.lipinski](https://forum.dynamobim.com/u/c.lipinski)\
**Post date:** [December 19, 2018, 11:21am UTC](https://forum.dynamobim.com/t/check-for-overrides/5576/13 "2018-12-19T11:21:56Z")

</div>

Hi Guys,  
Something doesn’t work for me. The Python Script gives this warning:  
Warning:  
IronPythonEvaluator.EvaluateIronPythonScript operation failed.  
Traceback (most recent call last):  
File “”, line 11, in   
AttributeError: ‘List[object]’ object has no attribute ‘Id’

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/4/043da4de22066cc4fce20f70855292f81834bad9.png)

---

<div class="post-metadata">

**Author:** ![Einar\_Raknes](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/einar_raknes/32/8566_2.png) [@Einar\_Raknes](https://forum.dynamobim.com/u/Einar_Raknes)\
**Post date:** [December 19, 2018, 2:33pm UTC](https://forum.dynamobim.com/t/check-for-overrides/5576/14 "2018-12-19T14:33:27Z")

</div>

IN[0] must be a flat list.

---

<div class="post-metadata">

**Author:** ![c.lipinski](https://avatars.discourse-cdn.com/v4/letter/c/7ba0ec/32.png) [@c.lipinski](https://forum.dynamobim.com/u/c.lipinski)\
**Post date:** [December 19, 2018, 2:57pm UTC](https://forum.dynamobim.com/t/check-for-overrides/5576/15 "2018-12-19T14:57:48Z")

</div>

Thanks a million.  
List.Flatten has done the trick.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/2/a206f0858ea41785d5fa5dff0bda87a23d1a03ea.png)

---

<div class="post-metadata">

**Author:** ![young](https://avatars.discourse-cdn.com/v4/letter/y/258eb7/32.png) [@young](https://forum.dynamobim.com/u/young)\
**Post date:** [October 25, 2022, 1:02am UTC](https://forum.dynamobim.com/t/check-for-overrides/5576/16 "2022-10-25T01:02:10Z")

</div>

Hi Einar\_Raknes,

I’m pretty new to python script and try to use yours but it seems not working with error message as shown image, Do you know how to fix this?

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/1/51e328c90b0ee69e6334391fde5978b576348097.png)

---

<div class="post-metadata">

**Author:** ![Ewan\_Opie](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ewan_opie/32/77070_2.png) [@Ewan\_Opie](https://forum.dynamobim.com/u/Ewan_Opie)\
**Post date:** [October 25, 2022, 6:35am UTC](https://forum.dynamobim.com/t/check-for-overrides/5576/17 "2022-10-25T06:35:33Z")

</div>

Hi @young  
This error is occurring because you haven’t plugged in any inputs to the node .

IN[0] a list of the elements  
and  
IN[1] a view that they are visible in.

---

<div class="post-metadata">

**Author:** ![young](https://avatars.discourse-cdn.com/v4/letter/y/258eb7/32.png) [@young](https://forum.dynamobim.com/u/young)\
**Post date:** [October 25, 2022, 10:35pm UTC](https://forum.dynamobim.com/t/check-for-overrides/5576/18 "2022-10-25T22:35:58Z")

</div>

It seems another error message popped up after following the same setting as the example above.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/b/6b08909e9d65d6574ba1916ee6f5cfe3ac1eb36d.png)

---

<div class="post-metadata">

**Author:** ![Ewan\_Opie](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ewan_opie/32/77070_2.png) [@Ewan\_Opie](https://forum.dynamobim.com/u/Ewan_Opie)\
**Post date:** [October 25, 2022, 10:46pm UTC](https://forum.dynamobim.com/t/check-for-overrides/5576/19 "2022-10-25T22:46:16Z")

</div>

Hi @young  
Can you please start a new topic and put a link to your comment in there, this is in keeping with forum guidelines as to not compromise the content of solved topics.  
I can continue to assist you once this is done 🙂

---

<div class="post-metadata">

**Author:** ![Hamish](https://avatars.discourse-cdn.com/v4/letter/h/a5b964/32.png) [@Hamish](https://forum.dynamobim.com/u/Hamish)\
**Post date:** [October 25, 2022, 11:12pm UTC](https://forum.dynamobim.com/t/check-for-overrides/5576/20 "2022-10-25T23:12:19Z")

</div>

You’re dealing with a thread from 2016. Revit 19 or 20 changed to allow a background and foreground fill for elements so there’s now a property for each rather than just one.

Check the API for the current properties: [OverrideGraphicSettings Members](https://www.revitapidocs.com/2022/bd467fbb-a9da-7cf1-1ef5-f0f3568db0ac.htm)

If you’re not capable with Python, and somebody else in the world has already done the work, I always suggest to just use their nodes. E.g. this one from GeniusLoci. You can then check the values and filter your list in the Dynamo environment and you’ll probably get a lot closer to a result than you will trying to copy paste code from a 6 year old forum without much Python knowledge.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/7/375e870801bd7826855b1ff110cb6a87ff7b86b7.png)

[Next page](https://forum.dynamobim.com/t/check-for-overrides/5576.md?page=2)
