# GeometryColor.ByGeometryColor inside Python

**URL:** <https://forum.dynamobim.com/t/geometrycolor-bygeometrycolor-inside-python/52724>\
**Category:** Geometry\
**Tags:** python, color\
**Created:** [July 7, 2020, 9:41pm UTC](https://forum.dynamobim.com/t/geometrycolor-bygeometrycolor-inside-python/52724 "2020-07-07T21:41:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![martin.stacey](https://avatars.discourse-cdn.com/v4/letter/m/9dc877/32.png) [@martin.stacey](https://forum.dynamobim.com/u/martin.stacey)\
**Post date:** [July 7, 2020, 9:41pm UTC](https://forum.dynamobim.com/t/geometrycolor-bygeometrycolor-inside-python/52724/1 "2020-07-07T21:41:40Z")

</div>

How can I change the color of a geometry inside python?  
I want to use the: `GeometryColor.ByGeometryColor`  
inside of a python node

---

<div class="post-metadata">

**Author:** ![andy.leong](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/andy.leong/32/97352_2.png) [@andy.leong](https://forum.dynamobim.com/u/andy.leong)\
**Post date:** [July 8, 2020, 12:11am UTC](https://forum.dynamobim.com/t/geometrycolor-bygeometrycolor-inside-python/52724/2 "2020-07-08T00:11:40Z")

</div>

you have to add the reference ‘GeometryColor’ and from the modifier class import GeometryColor

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

geom = IN[0]
color = IN[1]

OUT = GeometryColor.ByGeometryColor(geom, color)
```

---

<div class="post-metadata">

**Author:** ![martin.stacey](https://avatars.discourse-cdn.com/v4/letter/m/9dc877/32.png) [@martin.stacey](https://forum.dynamobim.com/u/martin.stacey)\
**Post date:** [January 17, 2022, 11:48am UTC](https://forum.dynamobim.com/t/geometrycolor-bygeometrycolor-inside-python/52724/3 "2022-01-17T11:48:45Z")

</div>

An extra tip:  
to be able to manipulate colors inside of python use the following references as well:

```auto
clr.AddReference('DSCoreNodes') 
import DSCore
from DSCore import *

```

---

<div class="post-metadata">

**Author:** ![c.poupin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/c.poupin/32/89152_2.png) [@c.poupin](https://forum.dynamobim.com/u/c.poupin)\
**Post date:** [January 17, 2022, 9:03pm UTC](https://forum.dynamobim.com/t/geometrycolor-bygeometrycolor-inside-python/52724/4 "2022-01-17T21:03:35Z")

</div>



---

<div class="post-metadata">

**Author:** ![c.poupin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/c.poupin/32/89152_2.png) [@c.poupin](https://forum.dynamobim.com/u/c.poupin)\
**Post date:** [January 18, 2022, 11:02am UTC](https://forum.dynamobim.com/t/geometrycolor-bygeometrycolor-inside-python/52724/5 "2022-01-18T11:02:41Z")

</div>


