# highlighting GeometryInstance

**URL:** <https://community.cesium.com/t/highlighting-geometryinstance/1124>\
**Category:** CesiumJS\
**Created:** [April 8, 2014, 9:01pm UTC](https://community.cesium.com/t/highlighting-geometryinstance/1124 "2014-04-08T21:01:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![thomlep](https://avatars.discourse-cdn.com/v4/letter/t/43a26b/32.png) [@thomlep](https://community.cesium.com/u/thomlep)\
**Post date:** [April 8, 2014, 9:01pm UTC](https://community.cesium.com/t/highlighting-geometryinstance/1124/1 "2014-04-08T21:01:58Z")

</div>

Hey guys,

Great job so far on Cesium! We're developing a tool for viewing and manipulating airspaces and we've come to a point where we'd like to select a 3d airspace from a GUI tree and emphasize the appearance of the selected feature on the map.

The question is, should we wait for the next release for a dynamic way to setColor on a Cesium.GeometryInstance . According to the docs the color attribute ColorGeometryInstanceAttribute is constant for the entire instance.

I'm thinking the best way at this point is to set a new color attribute and re-render the primitive, or to destroy the primitive and re-create, but that sounds expensive.

General thoughts?

Thanks  
Tom

// related code snippet.  
var bottomPolygonOutlineInstance =  
new Cesium.GeometryInstance({  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;geometry : $Cesium.PolygonOutlineGeometry.fromPositions({  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;positions : bottomPositions,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;perPositionHeight : true,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;extrudedHeight : obj.properties.ceiling,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;height : obj.properties.floor  
&nbsp;&nbsp;&nbsp;}),  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;attributes : {  
&nbsp;&nbsp;color : new Cesium.ColorGeometryInstanceAttribute(red,green,blue, 1)  
&nbsp;&nbsp;&nbsp;&nbsp;}  
});

---

<div class="post-metadata">

**Author:** ![patrick](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/patrick/32/2045_2.png) [@patrick](https://community.cesium.com/u/patrick)\
**Post date:** [April 9, 2014, 1:42pm UTC](https://community.cesium.com/t/highlighting-geometryinstance/1124/2 "2014-04-09T13:42:23Z")

</div>

Hi Tom,

It is possible to update the color after creating the geometry instance. See the “Updating Per-Instance Attributes” section of the [tutorial](http://cesiumjs.org/2013/11/04/Geometry-and-Appearances/) for a code example.

Patrick
