---
title: "system.mes.createSegment"
id: "system-mes-createsegment"
project: "MES User Manual"
url: "https://docs.sepasoft.com/articles/user-manual/system-mes-createsegment"
updated: 2026-07-31T14:58:37Z
---

# system\.mes\.createSegment

**Sepasoft MES Module Suite**

### system.mes.createSegment

Create a new [MESResponseSegment](/articles/user-manual/response-segment) from a specified [Operations Response](/articles/user-manual/operations-response). Creating a new instance of a MESResponseSegment object is needed to begin a segment. These functions use the currently running Operations Response if one is not specified as a parameter.

**Do not use these function In a multi-operation use-case**, where more than one operation is running on an equipment item. For multi-operation use-cases, use [system.mes.createOperation()](/articles/user-manual/system-mes-createoperation) (followed by creating the response segment for the newly created and started operation).

#### system.mes.createSegment(definitionSegment, equipmentPath)

| ![Note](/resources/Storage/user-manual/user-manual/Note.png) | When creating a segment without the auto assign parameter, the **default is auto assign is set to True**. |
| --- | --- |

#### system.mes.createSegment(definitionSegment, equipmentPath)

* Parameters

[AbstractMESObject](/articles/user-manual/abstractmesobject) **definitionSegment** - The operations segment to base the response segment on.

String **equipmentPath** - Equipment path of the equipment to use when creating the segment. This is required and is used when a material class is specified in the segment, it has to be replaced with the specific equipment.

* Returns

A new [MESResponseSegment](/articles/user-manual/response-segment) object.

* Scope

All

```python
#Creates a segment for a given equipment path and segment name 
system.mes.createSegment('Receive Turkeys', 'My Enterprise\California\Receiving\Unload Station 1', True, True)
```

#### system.mes.createSegment(definitionSegment, equipmentPath, autoAssignOptions)

Syntax

**system.mes.createSegment(definitionSegment, equipmentPath, autoAssignOptions)**

* Parameters

[AbstractMESObject](/articles/user-manual/abstractmesobject)  **definitionSegment** - The operations segment to base the response segment on.

String **equipmentPath** - Equipment path of the equipment to use when creating the segment. This is required and is used when a material class is specified in the segment, it has to be replaced with the specific equipment.

Boolean **autoAssignOptions** - If true, automatically assign material, lot and person options. Otherwise, they have to be set prior to beginning the segment.

* Returns

A new [MESResponseSegment](/articles/user-manual/response-segment) object.

* Scope

All

```python
#Creates a segment for a given equipment path and segment name 
system.mes.createSegment('Receive Turkeys', 'My Enterprise\California\Receiving\Unload Station 1', True, True)
```

#### system.mes.createSegment(operationsResponse, segmentName, equipmentPath, autoAssignOptions)

Syntax

system.mes.createSegment(operationsResponse, segmentName, equipmentPath, autoAssignOptions)

* Parameters

[MESOperationsResponse](/articles/user-manual/operations-response) object - The operations response to create the response segment for.

String **segmentName** - The name of the [operationsSegment](/articles/user-manual/operations-segment) to base the response segment on. If this property is empty, then the name of the operations response object will be used.

String **equipmentPath**- Equipment path of the equipment to use when creating the segment. This is required and is used when a material class is specified in the segment, it has to be replaced with the specific equipment.

Boolean **autoAssignOptions** - If true, automatically assign material, lot and person options. Otherwise, they have to be set prior to beginning the segment.

* Returns

A new[MESResponseSegment](/articles/user-manual/response-segment) object.

* Scope

All

#### system.mes.createSegment(operationResponse, segmentName, autoAssignOptions)

Syntax

system.mes.createSegment(operationsResponse, segmentName, autoAssignOptions)

* Parameters

[MESOperationsResponse](/articles/user-manual/operations-response)  **operationsResponse** - The operations response to create the response segment for.

String **segmentName** - The name of the operationsSegment to base the response segment on. If this property is empty, then the name of the operations response object will be used.

boolean **autoAssignOptions** - If true, automatically assign material, lot and person options. Otherwise, they have to be set prior to beginning the segment.

* Returns

A new [MESResponseSegment](/articles/user-manual/response-segment) object.

* Scope

All

```python
#Creates a segment for a given equipment path and segment name 
system.mes.createSegment('Receive Turkeys', 'My Enterprise\California\Receiving\Unload Station 1', True, True)
```

#### system.mes.createSegment(operationsSegmentName, equipmentPath, autoAssignOptions)

Syntax

system.mes.createSegment(operationsSegmentName, equipmentPath, autoAssignOptions)

* Parameters

String **operationsSegmentName** - The name of the operations segment to base the response segment on.

String **equipmentPath** - Equipment path of the equipment to use when creating the segment. This is required and is used when a material class is specified in the segment, it has to be replaced with the specific equipment.

boolean **autoAssignOptions** - If true, automatically assign material, lot and person options. Otherwise, they have to be set prior to beginning the segment.

* Returns

A new [MESResponseSegment](/articles/user-manual/response-segment) object.

* Scope

All

```python
#Creates a segment for a given equipment path and segment name 
system.mes.createSegment('Receive Turkeys', 'My Enterprise\California\Receiving\Unload Station 1', True, True)
```

#### system.mes.createSegment(operationsSegmentName, equipmentPath, autoAssignOptions, ignoreVersion)

Syntax

system.mes.createSegment(operationsSegmentName, equipmentPath, autoAssignOptions, ignoreVersion)

* Parameters

String **operationsSegmentName** - The name of the operations segment to base the response segment on.

String **equipmentPath** - Equipment path of the equipment to use when creating the segment. This is required and is used when a material class is specified in the segment, it has to be replaced with the specific equipment.

Boolean **autoAssignOptions** - If true, automatically assign material, lot and person options. Otherwise, they have to be set prior to beginning the segment.

boolean **ignoreVersion** - If true, will not validate the version of the segment. Useful if the segment could theoretically be altered elsewhere while it is being created.

* Returns

A new [MESResponseSegment](/articles/user-manual/response-segment) object.

* Scope

All

```python
#Creates a segment for a given equipment path and segment name 
system.mes.createSegment('Receive Turkeys', 'My Enterprise\California\Receiving\Unload Station 1', True, True)
```

**Sepasoft MES Module Suite**