Rhino 8 Python Components how to get TypeHint?

In the Legacy GHPython components we could easily get the user-defined type hints with a parameter TypeHint property but now that property seems to be obsolete in the new API. How would one get the type hint in the new IronPython and Python3 components?

#Obsolete in Rhino 8
for param in ghenv.Component.Params.Input:
    print(param.TypeHint.TypeName) 

Thanks for any help!

Use param.Converter instead:

for param in ghenv.Component.Params.Input:
    print(param.Converter.TypeName)

1 Like

woooo! thanks @eirannejad :raised_hands:

1 Like

One last thing… and I’m not sure how many people this would actually affect but I noticed in both IronPython and Python3 components is when a type hint is set to a Annotation TextDot the TypeName returns a generic type of object instead of TextDot

Which Rhino version? This is 8.8

Rhino_CemeKDyGyg

1 Like

Ok this was in Rhino 8.7, After trying in 8.8 I’m seeing the correct results as well :slight_smile:
Thank you!

1 Like

Thanks for testing!

1 Like