Stop/start Movement Function for Assemblies

Hello,

I would like for an assembly to start and stop on the marked stopper in the picture. I have already gotten this to work with a normal component.

However, when I try to use an assembly, the same function(stopMovement()/startMovement) won’t make it stop, so it just moves past the stopper.

So, I wanted to ask if there is a way to make the assembly stop at the stopper. I’ve already looked through the documentation and haven’t found anything yet.

Any help or suggestion would be appreciated.

Hello,
Could you share the layout here or in the support? StartMovement() should work with assemblies as well, so something is wrong.

here is the layout the issue is in the stopper_control python script.
When I select a Product in the Product creator it will stop fine on the stopper Sensor, but when I change to an assembly at the Product creator it will no longer stop.
Also important is that the path/conveyor will not be turned but instead only stop that part.

Shared Layout.vcmx (94.0 KB)

Hi, please re-save the layout with Include Components enabled from “Save As”. If it’s not enabled, imported geometries are not saved with the layout, and everything is invisible when the layout is opened on another computer.
image

yeah sorry I just wanted to re-upload it cause I noticed that too. You were a little to fast.
Shared Layout.vcmx (344.5 KB)

Also I tested it, the script goes into the correct statement just the function stopMovement doesn’t seem to work on assemblies.

Ah, I see the issue now.
The component signal to stop the product comes from volume sensor Vol4. As the component signal was using a precise test instead of bounding box intersection, it doesn’t detect the entire assembly but rather a part inside the assembly. We need to start/stop the movement of the upmost component in the hierarchy.

Assembly products in VC belong inside an invisible dynamic component ‘AssemblyBaseComponent’. This can be seen using the Inspector addon. The part that was detected by the volume sensor was two levels under the assembly base component:

For using raycast or volume sensors with assemblies, we can make a small addition to the script:


We call this function for the component signal’s value: while the detected component’s parent is not the conveyor, we go one level up in the node hierarcy. The Conveyor Sensor component’s raycasting mode has something similar.

Here’s the modified layout.
Shared Layout fixed.vcmx (343.1 KB)

(Note: ComponentPathSensor behaviour isn’t affected by this detail, as it detects the leading edge of a bounding box. The assembly base component’s bounding box is sized to fit the bounding boxes of all products inside the assembly. Also I believe there might be some built-in mechanism for detecting the correct component from the node hierarchy, but I am not sure.)

1 Like

Thank you sooo much!
I also appreciate the recommendation of the inspector addon.
I didn’t know that existed and it will definitely be useful to me in the future.