Check for Overrides

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

Overridden by element?

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->

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

I’m assuming individual, (element override).

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.

The custom node (Element.IsColorOverridden) is from Rhythm, I will publish this node soon.

Something like this?


##dynamo file
findOveriddenElements.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
	])
	)
6 Likes

This is exactly what I was thinking. Legend!

Possible with Linework overrides?

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?

Find Elements that are Overridden in View.dyn (10.4 KB)

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.

1 Like

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

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
	])
	)
3 Likes

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’

IN[0] must be a flat list.

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