2021-10-17 18:26:00 +02:00
|
|
|
---
|
2022-10-12 14:42:45 +02:00
|
|
|
title: Accessing options
|
2021-10-17 18:26:00 +02:00
|
|
|
---
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-12-22 17:24:59 -08:00
|
|
|
Options are available on the `options` key of from the object
|
2022-10-12 14:42:45 +02:00
|
|
|
passed to your part's draft method. You can destructure them for easy access.
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-10-12 14:42:45 +02:00
|
|
|
```design/src/part.mjs
|
2022-12-22 17:24:59 -08:00
|
|
|
function draftPart = ({
|
2022-10-12 14:42:45 +02:00
|
|
|
// highlight-start
|
2022-12-22 17:24:59 -08:00
|
|
|
options,
|
2022-10-12 14:42:45 +02:00
|
|
|
// highlight-end
|
2022-12-22 17:24:59 -08:00
|
|
|
part
|
2022-10-12 14:42:45 +02:00
|
|
|
}) {
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-12-22 17:24:59 -08:00
|
|
|
const a = options.fitKnee
|
|
|
|
const b = options[waistEase]
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-10-12 14:42:45 +02:00
|
|
|
return part
|
|
|
|
}
|
2021-08-25 16:09:31 +02:00
|
|
|
```
|
2022-10-12 14:42:45 +02:00
|
|
|
|
|
|
|
<Note>
|
|
|
|
|
|
|
|
Unlike measurements, options come with default values.
|
|
|
|
|
|
|
|
</Note>
|