No value for Cylinder.TotalHeight

I’am trying to port some scripts from Rhino 5 to Rhino 6. One main function is to analyse the position, size and orientation of a cylinder within another solid object.
My issue is that Cylinder.TotalHeight, Cylinder.Height1 and Cylinder.Height2 always pass 0.0.
The following code did work well in Rhino 5.

Guid = rs.GetObject(message="Auswahl ", preselect=True, filter=0)
Geometry = Rhino.DocObjects.ObjRef(Guid).Geometry()
Cylinder = Geometry.TryGetCylinder(0.01)[1]
 
print Cylinder.Height1
print Cylinder.Height2
print Cylinder.TotalHeight

Am I missing something?

TryGetCylinder returns an infinite cylinder if possible. you can use TryGetFiniteCylinder:

import rhinoscriptsyntax as rs
id = rs.GetObject('Auswahl', 0, True)
geo = rs.coercegeometry(id)
cyl = geo.TryGetFiniteCylinder(0.01)[1]
print cyl.TotalHeight

It works fine.
Thanks you Mahdiyar !