# How can you to add this Artboard

**URL:** <https://forums.creativeclouddeveloper.com/t/how-can-you-to-add-this-artboard/424>\
**Category:** UXP Plugin API\
**Created:** [November 19, 2018, 9:44pm UTC](https://forums.creativeclouddeveloper.com/t/how-can-you-to-add-this-artboard/424 "2018-11-19T21:44:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![activeguild](https://avatars.discourse-cdn.com/v4/letter/a/7993a0/32.png) [@activeguild](https://forums.creativeclouddeveloper.com/u/activeguild)\
**Post date:** [November 19, 2018, 9:44pm UTC](https://forums.creativeclouddeveloper.com/t/how-can-you-to-add-this-artboard/424/1 "2018-11-19T21:44:55Z")

</div>

How can you to add this Artboard.

RootNode Children add Artboard.

In the way below, it does not work.  
Am I making a mistake?

```auto
function myCommand(selection, documentRoot) {
    let art = new Artboard();
    art.width = 100;
    art.height = 100;
    documentRoot.addChild(art)  
}

```

---

<div class="post-metadata">

**Author:** ![pklaschka](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/pklaschka/32/3162_2.png) [@pklaschka](https://forums.creativeclouddeveloper.com/u/pklaschka)\
**Post date:** [November 20, 2018, 10:04am UTC](https://forums.creativeclouddeveloper.com/t/how-can-you-to-add-this-artboard/424/2 "2018-11-20T10:04:15Z")

</div>

Sorry, but is this meant as a question (it’s not quite clear since you used `.` and not `?` which means this could also be meant as a tip on how to add artboards…)?

First of all, you have one obselete closing brace `}` in line 6 😉

Also, you can wrap code in ``` [new line] [your code] [new line] ```. I’ve taken the liberty of formatting it for you 😉

---

<div class="post-metadata">

**Author:** ![activeguild](https://avatars.discourse-cdn.com/v4/letter/a/7993a0/32.png) [@activeguild](https://forums.creativeclouddeveloper.com/u/activeguild)\
**Post date:** [November 20, 2018, 11:01am UTC](https://forums.creativeclouddeveloper.com/t/how-can-you-to-add-this-artboard/424/3 "2018-11-20T11:01:18Z")

</div>

Thank ynu pklaschka.  
updated issue.

---

<div class="post-metadata">

**Author:** ![pklaschka](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/pklaschka/32/3162_2.png) [@pklaschka](https://forums.creativeclouddeveloper.com/u/pklaschka)\
**Post date:** [November 20, 2018, 11:19am UTC](https://forums.creativeclouddeveloper.com/t/how-can-you-to-add-this-artboard/424/4 "2018-11-20T11:19:24Z")

</div>

> [@pklaschka](#):
>
> you have one obsolete closing brace `}` in line 6 😉

If you remove this and (optionally) add a semicolon after `documentRoot.addChild(art)`, it should work.

---

<div class="post-metadata">

**Author:** ![activeguild](https://avatars.discourse-cdn.com/v4/letter/a/7993a0/32.png) [@activeguild](https://forums.creativeclouddeveloper.com/u/activeguild)\
**Post date:** [November 20, 2018, 9:19pm UTC](https://forums.creativeclouddeveloper.com/t/how-can-you-to-add-this-artboard/424/5 "2018-11-20T21:19:00Z")

</div>

I fixed it but I could not do it.

---

<div class="post-metadata">

**Author:** ![pklaschka](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/pklaschka/32/3162_2.png) [@pklaschka](https://forums.creativeclouddeveloper.com/u/pklaschka)\
**Post date:** [November 20, 2018, 11:36pm UTC](https://forums.creativeclouddeveloper.com/t/how-can-you-to-add-this-artboard/424/6 "2018-11-20T23:36:30Z")

</div>

Sorry. I forgot that you’ll need to import `Artboard` from the scenegraph module. Add

```auto
const {Artboard} = require('scenegraph');

```

before the function (resulting in the code below) and it should work (i.e. it does work – I’ve just tested it) 😉

```auto
const {Artboard} = require('scenegraph');

function myCommand(selection, documentRoot) {
   let art = new Artboard();
   art.width = 100;
   art.height = 100;
   documentRoot.addChild(art)  
}

```
