Making parts of a product invisible

Hi all,

I’m working on a project in which I have to feed flexible material from a roll:


In real life the roll rotates and the material will be transported as a layer on the conveyor and is then cut based on the required length.

In visual components I’m feeding the material as a flat product with the required length directly onto the conveyor:

The black frame will be enclosed so this is perfect. However, the only problem I’m facing is that the product sticks out of the frame because the required length is larger than the frame dimension:

Is there a way to make part of the product that is sticking outside invisible?
For example, can you make parts of a product invisible when they are inside a bounding box?

From this post it seems that something like that should be possible:
Revealing effect - Extensions and Python Add-ons - Visual Components - The Simulation Community

Something like this?

I used a ‘Cube’ from ‘Products and Containers’ and a Sensor Conveyor. In the config script of the conveyor, I edited the OnRun function as follows:

def OnRun():
comp = getComponent()
sensorSignal = comp.findBehaviour(‘SensorSignal’)
startStopSignal = comp.findBehaviour(‘StartStop’)

while True: #Change this to while True: if OnRun -loop is needed
triggerCondition(lambda: getTrigger() == sensorSignal and sensorSignal.Value)
part = sensorSignal.Value
for i in range(50):
part.CubeLength += 50
delay(0.15)