Hi all,
I’m trying to create something like this:
The feeder generate the same product type but with a real property named Prop1, for the example the Prop1 can be 1, 2 and 3.
There are 3 different sink and the product can be route randomly to any sink.
I know how to make the sink read the Prop1 and send a signal to the feeder with the value of the Prop1 but I dont know how to say to the feeder to create a product with same value of the signal riceived.
I suppose that i have to make a Python script like
def OnSignal():
if signal == 1
make product with Prop1 = 1
if…
You could do it with a normal Process, in the Process tab. If you create (or transport in) the “ProductIn” then you can assign the value from its ProductProperty : ProductIn.PropertyName or its ComponentProperty : ProductIn.Component.PropertyName
With an If-loop, you can assign different value, according to which signal or property was received.
If you want to use a PythonScript : have a look at how the component “Signal Feeder” in the eCatalog (in Feeders) works.
Instead of a signal to recieve the name of a product to create, you could have a signal to receive the value of a specific property. and then, once you created your product, you can change its property like this:
product_type = product_type_manager.findProductType('Block')
if product_type:
product = product_type.createProduct(path)
# if it's a ComponentProperty
part = product.Component
part.getProperty('Prop1').Value = propValue
# if it's a ProductProperty
product.getProperty('Prop1').Value = propValue