I have just tried this script that I have made based on yours and I could retrieve the radius value from the selected sphere which is considered good to me.
private void RunScript(bool x, ref object A)
if(x == true)
const ObjectType filter = Rhino.DocObjects.ObjectType.Brep;
Rhino.Commands.Result objRef = Rhino.Input.RhinoGet.GetOneObject("Select curve to divide", false, filter, out objref);
A = objref.Object().Attributes.GetUserString("radius");
Now I want to show that in the properties list in Rhino viewport when I select the sphere. Do you have an idea on how to axis this properties list and change it ?.