PLS teach me about this error
Hy,
I think outpath is not definedâŚ
Can you show where is outpath declared??
Regards
Feature
Hy,
in the Python-Script.
Regards
Feature
from vcScript import *
import vcMatrix
finalizing = True
def OnRun():
global outPath
s = comp.findBehaviour(âBatchSignalâ)
BatchReadySignal = comp.findBehaviour(âBatchReadySignalâ)
StartStop = comp.findBehaviour(âStartStopâ)
Post_Batch_Task = comp.getProperty(âPostBatchTaskâ)
#if Post_Batch_Task.Value == âReleaseBatchDownstreamâ:
#comp.PackBatchToOneComponent = True
while True:
triggerCondition(lambda: getTrigger() == s and s.Value)
p = s.Value
if Post_Batch_Task.Value == âDeleteFinishedBatchâ:
comp.findBehaviour(âOne-WayPath__HIDE__â).Enabled = False
delay(1)
p.delete()
comp.findBehaviour(âOne-WayPath__HIDE__â).Enabled = True
if Post_Batch_Task.Value == âBatchSignalToRobotâ:
comp.findBehaviour(âOne-WayPath__HIDE__â).Enabled = False
BatchReadySignal.signal( True )
triggerCondition(lambda: getTrigger() == StartStop and StartStop.Value == True)
comp.findBehaviour(âOne-WayPath__HIDE__â).Enabled = True
BatchReadySignal.signal( False )
if Post_Batch_Task.Value == âReleaseBatchDownstreamâ:
delay(0.001)
comp.findBehaviour(âOne-WayPath__HIDE__â).Enabled = False
if outPath :
outPath.grab§
delay(comp.BatchReleaseTime)
comp.findBehaviour(âOne-WayPath__HIDE__â).Enabled = True
else:
print âno conveyor connected downstream!â
def OnFinalize():
global finalizing
finalizing = False
def typechange(args):
comp = getComponent()
comp.findBehaviour(âOne-WayPath__HIDE__â).Speed = comp.getProperty(âConveyorSpeedâ).Value
comp.findBehaviour(âOne-WayPath__HIDE__â).Capacity = comp.getProperty(âConveyorCapacityâ).Value
def OnUserGeometrySet(var):
gf = comp.getFeature(âCustomUserGeometryâ)
gf.Uri = var.Value
ssw = comp.getFeature(âVCGeometryVsUserGeometryâ)
ssw.Choice = â1â
if not gf.Geometry.GeometrySetCount:
gf.Uri = ââ
comp.getProperty(âUserGeometry::GeometryFileâ).Value = ââ
print âWARNING fromâ, comp.Name,â Invalid geometry file set as UserGeometry.â
ssw.Choice = â2â
comp.rebuild()
Try to take the props from the preceding conveyor
def unifyProps(otherIface, offset):
global finalizing, speed, cWidth, cHeight, comp
if not finalizing and comp.AutomaticParametersEnabled:
cWidth.ChangeOnRebuild = False
cHeight.ChangeOnRebuild = False
speed.ChangeOnRebuild = False
cType.ChangeOnRebuild = False
rollRad.ChangeOnRebuild = False
rollDist.ChangeOnRebuild = False
sWeight.ChangeOnRebuild = False
if otherIface.Component.getProperty(âConveyorWidthâ):
cWidth.Value = otherIface.Component.getProperty(âConveyorWidthâ).Value
oldHeight = comp.ConveyorHeight
if otherIface.Component.getProperty(âConveyorHeightâ):
cHeight.Value = otherIface.Component.getProperty(âConveyorHeightâ).Value
if otherIface.Component.getProperty(âConveyorSpeedâ):
speed.Value = otherIface.Component.getProperty(âConveyorSpeedâ).Value
if otherIface.Component.getProperty(âConveyorTypeâ):
cType.Value = otherIface.Component.getProperty(âConveyorTypeâ).Value
if otherIface.Component.getProperty(âRollRadiusâ):
rollRad.Value = otherIface.Component.getProperty(âRollRadiusâ).Value
if otherIface.Component.getProperty(âRollDistanceâ):
rollDist.Value = otherIface.Component.getProperty(âRollDistanceâ).Value
if otherIface.Component.getProperty(âStructureWeightâ):
sWeight.Value = otherIface.Component.getProperty(âStructureWeightâ).Value
mtx = vcMatrix.new(comp.PositionMatrix)
mtx.translateRel(0,0,oldHeight-comp.ConveyorHeight)
comp.PositionMatrix = mtx
comp.Material = otherIface.Component.Material
cWidth.ChangeOnRebuild = True
cHeight.ChangeOnRebuild = True
speed.ChangeOnRebuild = True
cType.ChangeOnRebuild = True
rollRad.ChangeOnRebuild = True
rollDist.ChangeOnRebuild = True
sWeight.ChangeOnRebuild = True
comp.rebuild()
def connectPreceedingConveyor(otherIface, offset):
global outPath
outPath = otherIface.Component.findBehavioursByType(VC_ONEWAYPATH)[0]
def disconnectPreceedingConveyor(otherIface):
global outPath
outPath = None
comp = getComponent()
path = comp.findBehaviour(âOne-WayPath__HIDE__â)
sWeight = comp.getProperty(âStructureWeightâ)
rollRad = comp.getProperty(âRollRadiusâ)
rollDist = comp.getProperty(âRollDistanceâ)
cType = comp.getProperty(âConveyorTypeâ)
cWidth = comp.getProperty(âConveyorWidthâ)
cHeight = comp.getProperty(âConveyorHeightâ)
speed = comp.getProperty(âConveyorSpeedâ)
speed.OnChanged = typechange
cap = comp.getProperty(âConveyorCapacityâ)
cap.OnChanged = typechange
ugVar = comp.getProperty(âUserGeometry::GeometryFileâ)
ugVar.OnChanged = OnUserGeometrySet
inIface = comp.findBehaviour(âInInterfaceâ)
inIface.OnConnect = unifyProps
outIface = comp.findBehaviour(âOutInterfaceâ)
outIface.OnConnect = connectPreceedingConveyor
outIface.OnUnConnect = disconnectPreceedingConveyor
Hy,
I think there is no conveyor connected? â Will you post every Error in your Python-Script? â Have you tried to find the mistake on your own?
Regards
Feature
def OnRun():
global outPath
s = comp.findBehaviour(âBatchSignalâ)
BatchReadySignal = comp.findBehaviour(âBatchReadySignalâ)
StartStop = comp.findBehaviour(âStartStopâ)
Post_Batch_Task = comp.getProperty(âPostBatchTaskâ)
#if Post_Batch_Task.Value == âReleaseBatchDownstreamâ:
#comp.PackBatchToOneComponent = True
while True:
triggerCondition(lambda: getTrigger() == s and s.Value)
p = s.Value
if Post_Batch_Task.Value == âDeleteFinishedBatchâ:
comp.findBehaviour(âOne-WayPath__HIDE__â).Enabled = False
delay(1)
p.delete()
comp.findBehaviour(âOne-WayPath__HIDE__â).Enabled = True
if Post_Batch_Task.Value == âBatchSignalToRobotâ:
comp.findBehaviour(âOne-WayPath__HIDE__â).Enabled = False
BatchReadySignal.signal( True )
triggerCondition(lambda: getTrigger() == StartStop and StartStop.Value == True)
comp.findBehaviour(âOne-WayPath__HIDE__â).Enabled = True
BatchReadySignal.signal( False )
if Post_Batch_Task.Value == âReleaseBatchDownstreamâ:
delay(0.001)
comp.findBehaviour(âOne-WayPath__HIDE__â).Enabled = False
if outPath :
outPath.grab§
delay(comp.BatchReleaseTime)
comp.findBehaviour(âOne-WayPath__HIDE__â).Enabled = True
else:
print âno conveyor connected downstream!â
I think you got an answer Feature
Hy,
I like it when people try to solve their Problems and came Up with specific questionsâŚ
Regards
Feature