# Modelical | ColorByParameter | Python code edit help needed

**URL:** <https://forum.dynamobim.com/t/modelical-colorbyparameter-python-code-edit-help-needed/47966>\
**Category:** Revit\
**Tags:** python\
**Created:** [March 11, 2020, 3:00pm UTC](https://forum.dynamobim.com/t/modelical-colorbyparameter-python-code-edit-help-needed/47966 "2020-03-11T15:00:19Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![bvs1982](https://avatars.discourse-cdn.com/v4/letter/b/43a26b/32.png) [@bvs1982](https://forum.dynamobim.com/u/bvs1982)\
**Post date:** [March 12, 2020, 10:41am UTC](https://forum.dynamobim.com/t/modelical-colorbyparameter-python-code-edit-help-needed/47966/6 "2020-03-12T10:41:51Z")

</div>

I gonna go for a different approach. I will use the Python code provided in this 👇 topic.

> [@Element.OverrideInView but for multiple Views?](https://forum.dynamobim.com/t/element-overrideinview-but-for-multiple-views/37072/9):
>
> The Clockwork node View.OverrideElementTransparency works as expected but only if I set its lacing to longest. I think I can hack it. How to make this Python script by itself lace longest as there is no lacing setting on its node? [image]

Too soon. That script also overrides the lines. I don’t want to override the color of the lines.

EDIT  
Fixed the overrides lines

```
import clr
clr.AddReference("RevitAPI")
from Autodesk.Revit.DB import OverrideGraphicSettings, Color
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument

elements = UnwrapElement(IN[0])
views = UnwrapElement(IN[1])
fill_pattern = UnwrapElement(IN[2])
color_input = IN[3]
color_l= color_input.split(" ")
color = Color(int(color_l[0]),int(color_l[1]),int(color_l[2]))
TransactionManager.Instance.EnsureInTransaction(doc)
for i in elements:
	for view in views:		
		ogs = OverrideGraphicSettings()		
		ogs.SetProjectionFillColor(color)
		ogs.SetProjectionFillPatternId(fill_pattern.Id)
		ogs.SetCutFillPatternId(fill_pattern.Id)
		ogs.SetCutFillColor(color)
		ogs.SetHalftone(False)
		ogs.SetSurfaceTransparency(IN[4])
		view.SetElementOverrides(i.Id, ogs)	
TransactionManager.Instance.TransactionTaskDone()

```

---

_[View the full topic](https://forum.dynamobim.com/t/modelical-colorbyparameter-python-code-edit-help-needed/47966)._
