You are looking for casting. When putting objects into and pulling objects out of the viewport they are always cast as Entity as this is the parent class of all entities. If you want the cylinder properties you need to cast it to whichever child class you added to the viewport. Unfortunately there is no Cylinder child class of Entity, so I am assuming you made Mesh.CreateCylinder(). This is a Mesh class, and the variables (start and end points) you passed into the function are locally scoped to the function and are no longer available to be accessed by the Mesh class.
One approach to bypass this is to add this info into EntityData property of your entity. This property can hold any object you make.
public class myCylinderEntData
{
public double radius = 2d;
public double height = 5d;
public int slices = 10;
}
double dRadius = 2d;
double dHeight = 5d;
int iSlices = 10;
myCylinderEntData cyl1EntData = new myCylinderEntData() { radius = dRadius, height = dHeight, slices = iSlices };
Mesh cylinder1 = Mesh.CreateCylinder(dRadius, dHeight, iSlices);
cylinder1.EntityData = cyl1EntData;
vp1.Entities.Add(cylinder1); // Add to viewport
Entity retrivedEnt = vp1.Entities[0];
myCylinderEntData myRetrievedEntData = (myCylinderEntData)retrivedEnt.EntityData; // get Data back after clicked
int[] clickedEntsIndex = vp1.GetAllEntitiesUnderMouseCursor(Cursor.Position);// e.Location) ; // retrieve from viewport
Also if it is an available property of a class that inherits Entity you can retrieve the property like this.
int[] clickedEntsIndex = vp1.GetAllEntitiesUnderMouseCursor(Cursor.Position);// e.Location) ; // retrieve from viewport
foreach(int index in clickedEntsIndex)
{
if(vp1.Entities[index] is Mesh) // Check object type for whichever child class you want to convert to
{
Mesh myClickedMesh = (Mesh)vp1.Entities[index];
// Here you access to all of your Meshes public Variables
}
else if (vp1.Entities[index] is Solid)
{
Solid myClickedSolid = (Solid)vp1.Entities[index];
// Here you access to all of your Solid public Variables
}
}