---
title: "Script to change Changeover Time for all Op in a Line 3.0"
id: "script-to-change-changeover-time-for-all-op-in-a-line-3-0"
project: "Knowledge Base"
url: "https://docs.sepasoft.com/articles/knowledge-base/script-to-change-changeover-time-for-all-op-in-a-line-3-0"
updated: 2026-07-23T18:08:23Z
---

# Script to change Changeover Time for all Op in a Line 3\.0

you want to change the Changeover Time to N

## Step-by-step guide

run this Script

1. 
Code

```
eqPath = '<your Line Equipment Path up to Area>'

#this will stop all runs
areaObj = system.mes.loadMESObjectByEquipmentPath(eqPath)
for lineUUID in areaObj.getChildCollection():
	path = system.mes.loadMESObject(lineUUID).getEquipmentPath()
	if path == linePathToRun:
		system.mes.oee.endOEEProduction(path)


#this will change all segment changeover times to 15 seconds
newChangeoverTime = 15

filter = system.mes.object.filter.createFilter()
filter.setMESObjectTypeName('OperationsSegment')
filter.setEnableStateName('Enabled')

list = system.mes.searchMESObjects(filter)
i = 0
for op in list:
	opName = op.getName()
	#only run for line designated
	if linePathToRun in opName.replace(':','\'):
		#only need to change changeover segments
		if '_CO' in opName:
			segObj = op.getMESObject()
			segObjEndTrigger = segObj.getPrimaryEndTrigger()
			if segObjEndTrigger.getFixedDuration() != newChangeoverTime:
				segObjEndTrigger.setFixedDuration(newChangeoverTime)
				system.mes.saveMESObject(segObj)
				print '**saved** ',op.getName()
				
			else:
			 	print 'already ',newChangeoverTime,' seconds' ,op.getName()
```
