Extracting the coordinates and values of the text from an image in Legend

Thank you, you are right! @MingboPeng
I tested the code you provided me, and unfortunately, it didn’t work. However, that didn’t stop me from broadening my perspective. In the end, I managed to complete this example, and in my testing, it perfectly met my requirements.

import Rhino.Geometry as rg

# Input parameters
text_goo = Legend_Text

try:
    # Try to extract plane and text
    plane = text_goo.m_value.TextPlane
    text = text_goo.m_value.Text

    # Output parameters
    plane_output = plane
    text_output = text
except AttributeError:
    # If AttributeError exception is raised (no m_value attribute), set output parameters to None
    plane_output = None
    text_output = None

2 Likes