Auto Nick Name and Populate panel in GH Python

So, I went looking for a solution for this recently and it took WAY too long to find a working result.

To save others the same time in the future here it is:


panel = ghenv.Component.Params.Input[2].Sources[0]

if panel.NickName != name:
    panel.NickName = name
    panel.UserText = new_value
    panel.ExpireSolution(True)

the Input[2] selects which of the component inputs you are looking at, Source[0] selects the first (only) panel.

Cheers,

DK

250510_Auto Label GH Panel in Python.gh (6.5 KB)