Python Programming(pnp)

Part of the source

from vcScript import *

app = getApplication()

waypoint_VCID = ‘vcid:cc97b20c-c1b6-4c55-a1a0-4f91e13e4a06’ #vcid:eCatalog > Conveyor Template
def ComponentsLoad(prop=None):
conComponents = app.load(waypoint_VCID)
if not conComponents:
print ‘Error in component “{}”: Waypoint Component not found with VCID:{}. Make sure that your eCatalog is synchronized.’.format(comp.Name,exit_VCID)
for a in range(3):
cloneComponents = conComponents.clone()
pos = cloneComponents.WorldPositionMatrix
pos.translateRel(a*1000, 0, 0)
cloneComponents.PositionMatrix = pos

compLoadBtn.OnChanged = ComponentsLoad

This program is creating a button to create a component by clicking it.
I would like to know whether we can connect between item and component or feeder by using PNP from Python.
It would be very helpful if you can give me the method or hint to achieve this.

You can use the vcSimInterface connect method.


comp = getComponent()
app = getApplication()
other_comp = app.findComponent("Conveyor")
out_ife = comp.findBehaviour("OutInterface")
other_ife = other_comp.findBehaviour("InInterface")
1 Like