Script to bind an UDT to an instancied template


I’m trying to affect an UDT to a Motor instance (without UDT affected) by using script:

Button 1 -> Motor 1
Button 2 -> Motor 2

i have the UDT template reference with:

InstMotor = event.source.parent.getComponent(‘Motor’).Motor

but i don’t know how to bind Motor1 or Motor2 to InstMotor with script.

Excuse my poor english.