Instance IDs getting randomly assigned

When I’m adding my instances I am giving them an ID property but when I pick them later the ID is a random string of numbers and letters and not what I assigned.

Here is my code:

function createRadar(matrix, radar){

var instance = new Cesium.GeometryInstance({

geometry : new Cesium.HemisphereOutlineGeometry({

radius : radar.Max_Range,

minRange : radar.minRng,

minEl : radar.MinEl,

maxEl : radar.MaxEl,

angleAz : radar.Boresight_Half_Ang_Az,

stackPartitions : 10,

slicePartitions : 10


modelMatrix : matrix,

id: ‘S’ + radar.Name,

attributes : {

color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.YELLOW)



scene.primitives.add(new Cesium.Primitive({

geometryInstances : instance,

appearance : new Cesium.PerInstanceColorAppearance({

flat : true





I have debugged and confirmed that “‘S’ + radar.Name” outputs the string I want but when I pick it I get an ID like this “12a0a0f1-f5d9-47f6-a12f-0b8fe04f5358”

Any idea why my ID is getting overwritten by a random unique ID?

I’m wondering if your confusing the primitive’s _guid it’s _instanceIds.

If you look at the screenshot I attached. The primitive I created using your code sample has both a guid I did not set and in the _instanceIds array I see the ID that I set during the geometry instantiation.

Let me know if you’re not seeing the same when you inspect the viewer.scene.primitives collection.

Ah I see.

I wrote my picking code to grab the ID from entities which is in a different location than a primitive ID. I’ll have to check which type it is before pulling the ID to display it.

From a drill pick this is what got me the ID from the entity pickedObjects[i].id._id and this gets it from a primitive pickedObjects[i].id.

Thanks for the help!

Glad I could help