# system.kanoa.tooling.savePositions(toolingAssetId, positions, userId)

Replaces a tool's positions, matched by positionNumber: existing numbers are updated, new ones added, missing ones removed. Refused while the tool is mounted (use setPositionBlocked or setPositionRetired), for a removed position with mount history (retire it instead), and for a pocket that holds a tool and would stop being a pocket. Positions need the tool's hasPositions on, and a pocket needs holdsInserts on; an empty list is always allowed.

---

### Parameters

**toolingAssetId** `Integer`: The tool<br />

**positions** `List`: List of dicts<br />
<table class='dictionaryKeyTable'>
 <tbody>
  <tr><td> - positionNumber</td><td>Integer</td><td>Required, unique on the tool</td></tr>
  <tr><td> - positionType</td><td>String</td><td>'cavity', 'out', 'station', 'nest', 'pick' or 'pocket'. A pocket holds another tool</td></tr>
  <tr><td> - name</td><td>String</td><td></td></tr>
  <tr><td> - itemId</td><td>Integer</td><td>Optional. Set it only on a family tool: the position then counts only for that item. With no item, the position makes whatever item is running</td></tr>
  <tr><td> - outputQty</td><td>Integer</td><td>Parts per cycle from this position. Must be 0 for a pocket, which also can't have an itemId. Defaults to 0</td></tr>
  <tr><td> - isBlocked</td><td>Boolean</td><td></td></tr>
  <tr><td> - blockReason</td><td>String</td><td>'ratio', 'quality' or 'other'. Out of service for now: still counts toward the standard rate</td></tr>
  <tr><td> - isRetired</td><td>Boolean</td><td>Out of service for good: leaves the standard rate. A retired position isn't blocked</td></tr>
 </tbody>
</table>

**userId** `Integer`: The user making the change<br />

---

### Returns

**(positionCount, message)**<br />

---

### Example

```python
toolingAssetId = 1
positions = {'positionNumber': 1, 'positionType': 'cavity', 'name': 'name', 'itemId': 1, 'outputQty': 1}
userId = 5
positionCount, message = system.kanoa.tooling.savePositions(toolingAssetId, positions, userId)
```
