I was trying to create a Drawing Excercise addon for myself with different challenges, so I made a bunch of Geometry Node setups where each one has a Seed input socket that I want to set with code
A modifier looks something like this:
Here is the relevant code snippet:
mod = obj.modifiers.new(name=modf, type='NODES')
mod.node_group = ng
seed = random.randint(0, 1000)
for item in ng.interface.items_tree:
if item.item_type == "SOCKET" and item.in_out == "INPUT":
if item.name == "Seed":
# Set the value on the modifier instance using its identifier
seed_var = getattr(mod.properties.inputs,item.identifier)
seed_var.value = seed
break
This works but it feels hacky since properties supposed to be readonly
I tried to set it with:
mod[item.identifier] = seed
as I see suggested in other posts but I get this error:

I tried looking at the documentation here: NodesModifier
Where it said properties is of type NodesModifierProperties but when I tried to print the type() it said GeometryNodesModifierInterface which I found no documentation for also when I try to access the .values() or .items() I get this error:

Eventhough they are listed in the Inherited Functions section
So I really don’t know how to debug such objects other than dir() the whole thing.
I just wanted to share this to eliviate my frustration whith the horrendous API documentation.
Am I missing something, is there a better way?
