Download polylines

I am referring to the Sandcastle example where lines are digitised on the terrain.
Drawing on Terrain - Cesium Sandcastle
This creates a new entity and I can see the x, y points in the array activeShapePoints.
I thought I would be able to set the ID or parent of the entity, but it remains as a Cesium entity?

Please could someone explain how do I access this new entity and download it?


I managed to do it by invoking a function before the activeShapePoints are re-set (RH mouse button).
In this function I created another entity, passed it through the a routine to re-format as a string and used which dives option to save/ saveas or cancel.