1
0
Fork 0
freesewing/sites/dev/docs/reference/store-methods/cutlist.getcutfabrics
BenJamesBen 788ea77ffa
fix(docs) Add missing cutlist store methods and improve cutlist docs (#7052)
* fix(docs): cutlist.removeCut() can remove all cutting instructions

* fix(docs): Add cutlist.setcut doc

* fix(docs): cutlist.addcut() signature and other improvements

* fix(docs): cutlist store methods improvements

* fix(docs) Add missing cutlist store methods

* fix(docs): Remove cutlist store methods docs from old docs location

* fix(docs): Add missing cutlist store methods

---------

Co-authored-by: Benjamin Fan <ben-git@swinglonga.com>
2024-11-16 15:39:49 +01:00
..
readme.mdx fix(docs) Add missing cutlist store methods and improve cutlist docs (#7052) 2024-11-16 15:39:49 +01:00

---
title: cutlist.getCutFabrics()
---

The `cutlist.getCutFabrics()` store method will retrieve the stored
list of fabrics used by the pattern for given settings.

## Signature

```js
Array store.cutlist.getCutFabrics(settings)
```

The `custlist.getCutFabrics()` method returns an array of strings
containing the material names.

## Example

<Example caption="An example of the cutlist.getCutFabrics() store method">
```js
({ Point, points, Path, paths, store, context, part }) => {

    store.cutlist.addCut({cut: 2, from: 'fabric' })
    store.cutlist.addCut({cut: 2, from: 'lining' })

    const materials = store.cutlist.getCutFabrics(context.settings)

    let y = 0
    points.header = new Point(0, y).addText('Materials used:')
    for (let material of materials) {
      y += 8
      points[material] = new Point(5, y).addText(material)
    }

// Prevent clipping
paths.diag = new Path()
.move(new Point(-10,-20))
.move(new Point(80,35))

return part
}

```
</Example>
```