Sepasoft MES Module Suite
system.mes.object.list.createList()
This script function is used to create a list of MES objects.
Syntax
system.mes.object.list.createList()
Parameters
None
Returns
MES Object List - The list of MES objects.
Scope
All
Code Example
Python |
#This code snippet will create a list m1 = system.mes.loadMESObject('Butterball Turkey', 'MaterialDef') m2 = system.mes.loadMESObject('Free Range Turkey', 'MaterialDef') objList = system.mes.object.list.createList() objList.add(m1) objList.add(m2) system.mes.saveMESObjects(objList) |
Python |
#Creates a list of MES objects objList = system.mes.object.list.createList() #Load the objects to be added m1 = system.mes.loadMESObject('Bulk Almonds', 'MaterialDef') m2 = system.mes.loadMESObject('Bulk Peanuts', 'MaterialDef') #Adds the objects to list objList.add(m1) objList.add(m2) #Save the changes system.mes.saveMESObjects(objList) #This code snippet will check if the list contains only one MES object print objList.hasSingleMESObject() #Gets info about the object specified by the uuid print objList.findByUUID('a3f05165-1cee-4661-a1e8-d282bf2c6a02') #Creates a filter filter = system.mes.object.filter.createFilter() filter.setEnableStateName('ENABLED') filter.setMESObjectNamePattern('Receive *') mesList = system.mes.loadMESObjects(filter) #Adds the elements in list 'mesList' to the list 'objList' objList.addAll(mesList) #Removes all the objects from the list objList.removeAll(mesList) |
Output
Python |
True True False MaterialDef (a3f05165-1cee-4661-a1e8-d282bf2c6a02, Bulk Almonds, 1 parents, 0 children, 2 custom properties, 0 complex properties) True True |
Sepasoft MES Module Suite