2021-10-17 18:26:00 +02:00
|
|
|
---
|
|
|
|
title: hd
|
|
|
|
---
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-09-30 04:39:30 +02:00
|
|
|
The `hd` macro adds a _horizontal dimension_ to your pattern.
|
2023-10-29 17:20:35 +01:00
|
|
|
|
|
|
|
It is provided by [plugin-annotations](/reference/plugins/annotations), which is
|
|
|
|
part of [core-plugins](/reference/plugins/core) (so it is available by default).
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-09-30 04:39:30 +02:00
|
|
|
## Signature
|
2021-08-25 16:09:31 +02:00
|
|
|
|
|
|
|
```js
|
|
|
|
macro('hd', {
|
2023-10-29 17:20:35 +01:00
|
|
|
String id = 'hd',
|
2022-09-30 04:39:30 +02:00
|
|
|
Point from,
|
2022-12-09 20:59:53 -08:00
|
|
|
Boolean noEndMarker,
|
2022-09-30 04:39:30 +02:00
|
|
|
Boolean noStartMarker,
|
|
|
|
String text,
|
|
|
|
Point to,
|
|
|
|
Number y,
|
2023-10-29 17:20:35 +01:00
|
|
|
Boolean force = false,
|
2021-08-25 16:09:31 +02:00
|
|
|
})
|
|
|
|
```
|
|
|
|
|
2022-09-30 04:39:30 +02:00
|
|
|
## Example
|
|
|
|
|
|
|
|
<Example caption="An example of a horizontal dimension with the hd macro">
|
|
|
|
```js
|
|
|
|
({ Point, macro, part }) => {
|
|
|
|
|
|
|
|
macro('hd', {
|
|
|
|
from: new Point(0,0),
|
|
|
|
to: new Point(100,0),
|
2023-10-29 17:20:35 +01:00
|
|
|
y: 15,
|
|
|
|
force: 1,
|
2022-09-30 04:39:30 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
return part
|
|
|
|
}
|
|
|
|
```
|
|
|
|
</Example>
|
|
|
|
|
|
|
|
## Configuration
|
|
|
|
|
2022-02-19 08:04:25 +01:00
|
|
|
| Property | Default | Type | Description |
|
2021-08-25 16:09:31 +02:00
|
|
|
|----------------:|----------|---------------------|-------------|
|
|
|
|
| `from` | | [Point](/reference/api/point) | The startpoint of the dimension |
|
|
|
|
| `to` | | [Point](/reference/api/point) | The endpoint of the dimension |
|
|
|
|
| `y` | | Number | The Y-value at which to draw the dimension |
|
2023-10-29 17:20:35 +01:00
|
|
|
| `id` | `hd` | `string` | The ID of this macro instance |
|
2021-08-25 16:09:31 +02:00
|
|
|
| `text` | Horizontal distance | Number | The text to go on the dimension if not the from-to horizontal distance |
|
|
|
|
| `noStartMarker` | `false` | Boolean | Whether to not draw a start marker |
|
|
|
|
| `noEndMarker` | `false` | Boolean | Whether to not draw an end marker |
|
2023-10-29 17:20:35 +01:00
|
|
|
| `force` | `false` | `boolean` | Set this to `true` to display the macro output even when `paperless` is `false` |
|
2022-12-09 20:59:53 -08:00
|
|
|
|
2022-09-30 04:39:30 +02:00
|
|
|
## Notes
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2023-10-29 17:20:35 +01:00
|
|
|
This macro takes the `paperless` setting into account and won't output anything when both `paperless` and `force` are `false`.
|
2021-08-25 16:09:31 +02:00
|
|
|
|