# How to set up min/max/default value for node group socket via Python?

Could you tell me how to set min/max/default value for node group socket via Python? Something like this:

You can access it through the NodeGroup object's inputs:

glossinessFactorInput = bpy.data.node_groups["NodeGroup"].inputs['Glossiness Factor']

glossinessFactorInput.min_value     = -5.0
glossinessFactorInput.max_value     = 5.0
glossinessFactorInput.default_value = 1.5

• Thank you. My group is creating by an Operator so it works very well at the first time. When I hit this again button it doesn't work. It seems to work only for group without suffix (.001, .002). Have I put this code under "def execute(self, context):" for an Operator? – Mc Gavish Oct 11 '15 at 9:42
• If you create a group through an operator, you should also save the created group's name so you can access its inputs. You probably hardcoded the group's name into your code, so you always access the first group and not the later groups you create. Instead of hardcoding the group name, use a dynamic name based on the name of the group you created in your opreator. – TLousky Oct 11 '15 at 9:46
• Yes, I hardcoded its name. I'm sorry for my stupid question, but how to use a dynamic name? – Mc Gavish Oct 11 '15 at 9:53