Custom Script in Python for GH

Hello, community,
I’ve created a custom script in Python that allows extruding a curve or surface on both sides, given multiple parameters and variations. I am relatively novice to scripting… How can I add the desired container or required definitions to my script? (please, see an attached pic. I bring the “Blend Curve” node for demonstration purposes). Wh


ere can I find resources on this subject or would you recommend any tutorials?
Thx.

I’ve been after the same thing as you as far as the icon of the data type and have no solution there but I can at least help with the description you are after

At the beginning of your script you can add the following lines:

ghenv.Component.Params.Input[0].Name = " "
ghenv.Component.Params.Input[0].NickName = " "
ghenv.Component.Params.Input[0].Description = " "

Just insert the text you want to use for the names and description between the quotes.

If you have multiple inputs you can use the same lines just change the number after input to 1 or 2 or whatever the position of your input is on the component.

You can use the same code for the outputs just change the word input to output.

Also if you remove the word params you can set the name, nickname, and description of the overall component.

ghenv.Component.Name = “My Name”

Etc…

Cheers, hope this helps!

Hello, Michael,
That makes sense, useful indeed.

that’s a bit annoying but anyway…)))
Thank you. :pray:

I agree, I would like to be able to right click and set the values like you can with a cluster

1 Like

Sorry to bother you, Michael,
Is it possible to change this caption (“GhPython Script”) to the custom one?
The captions appear when we use “Sunglasses” or “Bifocals”.
Pyth

Should be this line for that ^ and then the following lines for the nickname and description

ghenv.Component.NickName = “My Nickname”
ghenv.Component.Description = “This is what my component does”

1 Like

Many thanks, Michael. :pray: :pray: :pray:

1 Like

You’re welcome Bakuri! Happy Coding :snake: