# Insert collapsed nodes programmatically

**URL:** <https://forum.universal-robots.com/t/insert-collapsed-nodes-programmatically/5226>\
**Category:** Product Wishlist\
**Created:** [September 30, 2019, 8:10am UTC](https://forum.universal-robots.com/t/insert-collapsed-nodes-programmatically/5226 "2019-09-30T08:10:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![adolfo](https://avatars.discourse-cdn.com/v4/letter/a/3da27b/32.png) [@adolfo](https://forum.universal-robots.com/u/adolfo)\
**Post date:** [September 30, 2019, 8:10am UTC](https://forum.universal-robots.com/t/insert-collapsed-nodes-programmatically/5226/1 "2019-09-30T08:10:07Z")

</div>

When developing templates, it can be the case that there exist multiple sequences or hooks that the user needs to interact with and customize. To the best of my knowledge, Polyscope will always insert them expanded, which is undesired.

Consider a pick and place example. Ideally, this is what I would like to show upon insertion:

```
Robot program
  Pick and place <-- Top-level template node
    Object detection <-- Collapsed sequence nodes
    Pick
    Place

```

The above clearly shows the structure of the template, and allows the user to inspect each sequence node as desired. However, what one currently gets in Polyscope is a fully expanded tree, which is overwhelming and removes the emphasis from the separation into three main sequences (object detection, pick and place). In some cases, the fully expanded tree might not even fit in the screen.

```
Robot program
  Pick and place <-- Top-level template node
    Object detection <-- Fully expanded sequence node
      MoveJ
        Stuff
      Stuff
    Pick <-- Another fully expanded sequence node
      MoveJ
        Stuff
      MoveL
        Stuff
      Stuff
    Place <-- Another fully expanded sequence node
      MoveJ
        Stuff
      Stuff

```

It would be great if the SDK would allow inserting collapsed nodes, and provide the user with a cleaner experience.

---

<div class="post-metadata">

**Author:** ![jbm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/jbm/32/614_2.png) [@jbm](https://forum.universal-robots.com/u/jbm)\
**Post date:** [September 30, 2019, 8:53am UTC](https://forum.universal-robots.com/t/insert-collapsed-nodes-programmatically/5226/2 "2019-09-30T08:53:51Z")

</div>

@adolfo  
Thanks for this feature request. I have noted this.
