Good day,
maybe someone can help me is it possible to summarize a warehouse utilization, if I use the statistics function I have to add each shelf individually, then it looks like this:
For this situation, I would suggest to write a simple code for it.
from __future__ import division
from vcScript import *
app = getApplication()
def OnRun():
while True:
shelfs = [shelf for shelf in app.Components if shelf.getProperty("Tiers") and shelf.getProperty("Bays")]
cells = sum([shelf.Tiers * shelf.Bays for shelf in shelfs])
containers = [shelf.findBehavioursByType(VC_COMPONENTCONTAINER)[0] for shelf in shelfs]
partsCount = sum([container.ComponentCount for container in containers])
print "Average Utilization: %.2f %" % ((partsCount / cells) * 100.0)
# You can assign to a property, then let statistics show it
delay(1.0)
You can create a component, create a PythonScript for it, then you would need Professional or Premium version. Anyway, here is the updated file, by the way, the data update for every second, but your feed speed is too fast, so I slow down the feed speed.
Ok, I didnât know that Python only works with Professional and premium.
Thank you for your version, unfortunately it doesnât work for me.
I am using VC 4.5 Essentials, I thought there might be a solution within the statistics dashboard directly.
Your file shows the following errors in my VC:
Traceback (most recent call last):
File âWarehouse Shelf #14::Bufferâ, line 52, in OnStatementExecute
File âWarehouse Shelf #14::Bufferâ, line 260, in create_transport_items
NameError: Attribute or method âAcceptAllProductTypesâ not found.
Warehouse Shelf #14::ProcessExecutor__HIDE__ Error: The processes in this executor are not consuming simulation time, causing the simulation to hang. Stop the executor.
Warehouse Shelf::ProcessExecutor__HIDE__ Error: The processes in this executor are not consuming simulation time, causing the simulation to hang. Stop the executor.
Python works with all versions, but you could create a new component or create a new python script when youâre using Professional or Premium version. The error message is from PM system, I am using 4.8, so 4.5 load 4.8 would cause error, but itâs from PM. You can just load his component.
Yes perfect, it works.
I still think itâs a sad thing that VC doesnât directly offer the option of connecting storage shelves or merging areas statistically.