Access rhinoCommon property from object existing in rhinoscriptsyntax

Hi,

I have a very extensive script in rhinoscriptsyntax. I’d like to acces a rhinoCommon property from an object existing in rhinoscriptsyntax (e.g. justification, see script below). Is there a way to achieve this without using Selection methods? e.g. via GUID?

thanks,
Tim

for obj in textobjects:
    # select the object in rhinoscriptsyntax
    rs.UnselectAllObjects()
    rs.SelectObject(obj)
    
    # get the new object reference in rhinoCommon
    rc, objref = Rhino.Input.RhinoGet.GetOneObject("Select text", False, Rhino.DocObjects.ObjectType.Annotation)
    if rc!=Rhino.Commands.Result.Success: return
    
    # display the property for test purposes
    justification = objref.Object().TextGeometry.Justification
    rs.MessageBox(justification)

Hi @timcastelijn, you might get the RhinoObject like below without selection method:

rh_obj = rs.coercerhinoobject(obj, True, True)
justification = rh_obj.TextGeometry.Justification
rs.MessageBox(justification)

_
c.

Hi Clement,

Thank you!