Function to set component property

This works:

def setPropertyValue(component,propertyName,value):
	method = getattr(component,"set%s"% propertyName.title())	
 	method(value)

In this function we get the set method of the property and then call it to set the value.

1 Like