Python, addressing inside of variables

Hello Everyone !

let’s say I have a chop execute connected to a button comp and a ‘base1’ comp with a small network inside it.

My goal is:

  1. to make a copy of “base1” just below the original one once I click the button.

  2. change a value of a “constant1” chop inside the freshly copied base comp. (this is the part were I got stuck)

my code under onOffToOn so far:

	op_amt = len(me.parent().findChildren(name = 'base*'))
	new_base = op('../project1').copy(op('base1'))
	new_base.nodeY = op('base1').nodeY - (150 * op_amt)
        
here is where I'd like to change value of "constant1" inside the new_base.

	return

How do I write this ?
Any help appreciated

add this line:

op(new_base.path + '/constant1').par.value0 = 33

Also look into the Replicator COMP which could be easier to manage multiple copies of a component.

Super, thanks man :slight_smile: