Load cad-model on conveyor


I have been watching this video about how to attach a component to a conveyor: How to Attach Objects to Conveyor Paths | Visual Components Academy

I have imported a cad-model and done the same as in the video and it is working.

However I want to load my cad components from file and then make them move along the conveyor, which is not working. I am able to load the cad from the folder and place it on the conveyor and attach it, but it dos not move along with the conveyor, it is just standing still.

this is the code in the conveyor:

Can anyone help me with getting it move?

Are there any error messages in the output panel?

This works for me. I already have a part with name “idealPipe” in the layout.

from vcScript import *

def OnRun():
  part = app.findComponent("idealPipe")
  box = comp.ChildComponents[0]
  path = comp.findBehaviour("Path__HIDE__")

app = getApplication()
comp = getComponent()

No, there are no error message in the output panel.

The code works if the part allready is in the layout, but not if the code is importing the part first.