# Deleting a primitive by id

**URL:** <https://community.cesium.com/t/deleting-a-primitive-by-id/931>\
**Category:** CesiumJS\
**Created:** [January 14, 2014, 4:57pm UTC](https://community.cesium.com/t/deleting-a-primitive-by-id/931 "2014-01-14T16:57:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bengoldsh](https://avatars.discourse-cdn.com/v4/letter/b/e5b9ba/32.png) [@bengoldsh](https://community.cesium.com/u/bengoldsh)\
**Post date:** [January 14, 2014, 4:57pm UTC](https://community.cesium.com/t/deleting-a-primitive-by-id/931/1 "2014-01-14T16:57:44Z")

</div>

Hi !  
I have a collection of primitives ( billboards) . I want to delete a specific one . Is there a way to give every element a unique id and than delete it by its id?  
Is there a better way?

---

<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:** [January 15, 2014, 12:03am UTC](https://community.cesium.com/t/deleting-a-primitive-by-id/931/2 "2014-01-15T00:03:12Z")

</div>

The remove function takes an object instance so you need to have an instance to remove a primitive. Primitive’s also have an id property (like [this one](http://cesiumjs.org/Cesium/Build/Documentation/EllipsoidPrimitive.html?classFilter=ellipsoidp&show=js#id)), which is really used for picking. You can’t remove by this id, but you could create an object that maps from id to instance to do the lookup for deletion if you really need to.

Patrick
