Python Script Begineer_Component Creation

I just started to use VC and python script behavior. I am not able to understad the syntax till now or how it works.
I am trying to python script a product feeder that only creates a product when an external signal from a boolean button is pressed.
That is i want the product feeder to create a “Box” when i press TRUE and a “Cylinder” when i press “FALSE”
How to start coding it?

Hi Elvis,
did you risolve it?
I’m in the same trouble.
Please, let me know.

You don’t have to program a Python script.
If you use a Process node, you can use a WaitSignal to wait on a signal, with the “WaitTrigger” active, but without any condition and store the variable with the property “ValueOutputVariableName”.
When the signal is triggered, you can use an If-loop in which you check the ValueOutputVariableName in the condition (or switch-loop if you are not using a boolean signal and can have more than 2 outputs) and then either Create a block, or a a cylinder according to the value.

2 Likes

Thank you so much
this is very helpfull

There are many ways to create components. When there are not many components, you can use the PROCESS module to quickly perform operations, or you can use ready-made feeder class components to create them.
If you are learning how to create such a component, you can refer to the materials in the Academy:

If you are learning how to use Python scripts to create such a component, you can refer to functions such as Clone() and CloneComponent() in the manual.

1 Like