Copy of Find Supplemental Equipment for a Lot (Number) 3.0

Overview

This script will demonstrate how to find the Supplemental Equipment that is available for a given Lot #.

Applies To and Version Info

MES 2.0

Details

The explanation about how to work with is very well documented in the script.

Screenshots

N/A

Scripting

The general syntax of the script function.

Code Snippet

Code
# lot_name, sequence number (if -1 return greatest sequence number), onlyAvailableLot
material_lot = system.mes.loadMaterialLot('0000004051', -1, False)

# get UUID of Response Segment related to material lot
response_seg_uuid = material_lot.getPropertyValue('ResponseSegmentUUID')

# load response segment
response_seg = system.mes.loadMESObject(response_seg_uuid)

#list different complex properties available
print response_seg.getComplexPropertyTypeNames()

# list objects in complex property ResponseSupplementalEquipment
# use this if we are assigning a piece of supplemental equipment to the segment
print response_seg.getComplexPropertyItemNames('ResponseSupplementalEquipment')

# list objects in complex property ReponseMaterial 
# Use this if you have a piece of supplemental equipment you are storing to
material_list = response_seg.getComplexPropertyItemNames('ResponseMaterial')

# For all response materials get the equipment they used. Will return regular and suppl equipment
for i in range(0, len(material_list)):
    print response_seg.getComplexProperty('ResponseMaterial',i).getEquipmentRef().getMESObject()

Output

Code
>>> 
[ResponseMaterial, ResponseEquipment, ResponseSupplementalEquipment, ResponsePersonnel, ResponseProduction, TriggerRspSegBegin, TriggerRspSegEnd]
[]
MESResponseLine (cf246045-2695-4b2f-955e-15b52029633b, Packaging Line 1, 0 parents, 4 children, 0 custom properties, 0 complex properties)
>>> 

References

Supplemental Equipment Resource Property


Keywords

Supplemental Equipment, Lot Handling