# Projection Line Color in Python

**URL:** <https://forum.dynamobim.com/t/projection-line-color-in-python/17012>\
**Category:** Revit\
**Tags:** python\
**Created:** [December 1, 2017, 10:08am UTC](https://forum.dynamobim.com/t/projection-line-color-in-python/17012 "2017-12-01T10:08:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Claus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/claus/32/37199_2.png) [@Claus](https://forum.dynamobim.com/u/Claus)\
**Post date:** [December 1, 2017, 10:08am UTC](https://forum.dynamobim.com/t/projection-line-color-in-python/17012/1 "2017-12-01T10:08:40Z")

</div>

I am trying to overwrite the projection line colors of structural framing elements with Python.

So far I came up with this;

```
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

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

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager 

doc = DocumentManager.Instance.CurrentDBDocument

view = IN[0]
elements = IN[1]
#color_from_node = IN[2]
element_id = [3]

color = Autodesk.Revit.DB.Color(255,255,255)

output = []

ogs = OverrideGraphicSettings().SetProjectionLineColor(color)

#for i in elements:
	#doc.ActiveView.SetElementOverrides((i.Id), ogs)

OUT = view, elements, color, ogs

```

However when I set the `SetElemenOverrides` in the for loop it asks for an `ElementId` instead of Element. So I type `i.Id`. However then Python says I am trying to pass an integer instead of an ElementId. Am I missing some step to tell Python it’s an ElementId instead of an integer?

---

<div class="post-metadata">

**Author:** ![Nic](https://avatars.discourse-cdn.com/v4/letter/n/45deac/32.png) [@Nic](https://forum.dynamobim.com/u/Nic)\
**Post date:** [December 1, 2017, 1:59pm UTC](https://forum.dynamobim.com/t/projection-line-color-in-python/17012/2 "2017-12-01T13:59:45Z")

</div>

You can convert the integer to an ElementId with doc.ActiveView.SetElementOverrides(ElementId([i.Id](http://i.Id)), ogs). You’ll need to start and end transaction as well.

---

<div class="post-metadata">

**Author:** ![Claus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/claus/32/37199_2.png) [@Claus](https://forum.dynamobim.com/u/Claus)\
**Post date:** [December 1, 2017, 2:18pm UTC](https://forum.dynamobim.com/t/projection-line-color-in-python/17012/3 "2017-12-01T14:18:31Z")

</div>

Nice, worked like a charm! 😁

For those who are interested, the code and result

```
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

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

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager 

from System.Collections.Generic import List

doc = DocumentManager.Instance.CurrentDBDocument

TransactionManager.Instance.EnsureInTransaction(doc)

view = IN[0]
elements = IN[1]

color = Autodesk.Revit.DB.Color(255,25,0)

output = []

ogs = OverrideGraphicSettings().SetProjectionLineColor(color)

	
for i in elements:
	doc.ActiveView.SetElementOverrides(ElementId(i.Id), ogs)

TransactionManager.Instance.TransactionTaskDone()

```

The result;

 ![red_structural_framing_outline](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/9/59835db546c4a02f5fd95a044e3e263fd0217267.PNG)

On a side note, I spent almost half the day googling and trying to understand the Python API. I can’t seem to find any documentation for this.

---

<div class="post-metadata">

**Author:** ![APELAEZDELEE](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/apelaezdelee/32/37010_2.png) [@APELAEZDELEE](https://forum.dynamobim.com/u/APELAEZDELEE)\
**Post date:** [December 5, 2017, 12:25pm UTC](https://forum.dynamobim.com/t/projection-line-color-in-python/17012/4 "2017-12-05T12:25:07Z")

</div>

[http://www.revitapidocs.com/](http://www.revitapidocs.com/)
