Unable to access input parameter value with Python 3 in Rhino 8

I’m trying to use an old code example to rename a component’s input Name/NickName.

It fails in Python 3 but works fine in Python 2:

vd = ghenv.Component.Params.Input[0].VolatileData
firstItem = str(vd[0][0])

# Set names of first input parameter
ghenv.Component.Params.Input[0].Name = firstItem
ghenv.Component.Params.Input[0].NickName = firstItem


Hi @Jonathan_Garrison ,

Here’s how I have it in one of my Py3 scripts and it works for me in the most recent update.

ghenv.Component.Params.Input[0].Name = “Curve”
ghenv.Component.Params.Input[0].NickName = “C”
ghenv.Component.Params.Input[0].Description = “Input Curves”

ghenv.Component.Params.Input[1].Name = “T”
ghenv.Component.Params.Input[1].NickName = “T”
ghenv.Component.Params.Input[1].Description = “Curve Thickness”

ghenv.Component.Params.Input[2].Name = “Color”
ghenv.Component.Params.Input[2].NickName = “Pc”
ghenv.Component.Params.Input[2].Description = “Preview Color”

EDIT:

I see, you’re dynamically updating the input name though. Not sure on that one sorry. Curious to know though myself

1 Like

Today I found similar problem.
It seems Jonathan is right. VolatileData dose not show proper data in Python 3 Rhino 8.

is this bug?
Just in case I attatch my grasshopper file also.


VolatileDataNotWork.gh (162.5 KB)

1 Like