# Flatten-1D

**URL:** <https://forum.dynamobim.com/t/flatten-1d/34162>\
**Category:** Revit\
**Created:** [March 29, 2019, 5:14pm UTC](https://forum.dynamobim.com/t/flatten-1d/34162 "2019-03-29T17:14:35Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![hiatt.kaitlyn](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/hiatt.kaitlyn/32/73640_2.png) [@hiatt.kaitlyn](https://forum.dynamobim.com/u/hiatt.kaitlyn)\
**Post date:** [March 29, 2019, 5:14pm UTC](https://forum.dynamobim.com/t/flatten-1d/34162/1 "2019-03-29T17:14:35Z")

</div>

Hi! I recently downloaded the Dynamo software for use with Revit. I am an Architecture student and am in the middle of a project and seem to be missing a tool that is key for this particular project. I actually seem to be missing an entire set. I searched up the Flatten tool that would take multidimensional lists and return a 1 dimensional list. I do not have this or any of the builtin tools. I seem to have only the List.Flatten tool. Any help would be appreciated!!! I looked for the package to download but came up empty handed.

edited: flatten tool type should be called just flatten. It’s description should read as follows: **Flatten**  
Returns the flattened 1D list of the multidimensional input list.

I only have this tool: **List.Flatten** Flattens a nested list of lists by a certain amount.

I am working on a parametric tower which I am trying to add a skin/cladding to. Every time I connect my cladding to my skin and add my List.Flatten (which I have connected a code block with the value of 1 to the amount slot to), I receive numerous errors across the board. I am at a loss here and cannot take the file in to my school for assistance due to the fact that my schools software corrupts my files every single time I have tried.

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [March 29, 2019, 5:46pm UTC](https://forum.dynamobim.com/t/flatten-1d/34162/2 "2019-03-29T17:46:56Z")

</div>

WhatTheNode from Rhythm can be very helpful for determining the package of a specific node.  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/d/bdcae1acc0bb262da043b37bce91759a8a0808f8.png)

I’m guessing Flatten would do what you’re looking for as well, but I’m not familiar with this node.

---

<div class="post-metadata">

**Author:** ![hiatt.kaitlyn](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/hiatt.kaitlyn/32/73640_2.png) [@hiatt.kaitlyn](https://forum.dynamobim.com/u/hiatt.kaitlyn)\
**Post date:** [March 29, 2019, 7:18pm UTC](https://forum.dynamobim.com/t/flatten-1d/34162/3 "2019-03-29T19:18:15Z")

</div>

I already know what package this tool belongs too but this is very helpful for the future!! Thank you!

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [March 29, 2019, 7:42pm UTC](https://forum.dynamobim.com/t/flatten-1d/34162/4 "2019-03-29T19:42:40Z")

</div>

Can you show us a screenshot of what’s happening?  
And maybe a visual of what you’re expecting?

List.Flatten is the updated node in 2.0. It gives you the option to flatten your list at different levels, but does the same thing as Flatten. We need more information to know what your particular issue is.

---

<div class="post-metadata">

**Author:** ![hiatt.kaitlyn](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/hiatt.kaitlyn/32/73640_2.png) [@hiatt.kaitlyn](https://forum.dynamobim.com/u/hiatt.kaitlyn)\
**Post date:** [March 29, 2019, 7:57pm UTC](https://forum.dynamobim.com/t/flatten-1d/34162/5 "2019-03-29T19:57:57Z")

</div>

![ParamTowerScrnSht](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/a/1a70c3381d772fe4e960b7a35b20409d6090f1ed.png)

Sorry if it is difficult to see the image…  
This is what is happening. It is difficult to show you what I am expecting because it comes from a video and the person doesn’t show the full screen, just the nodes they are working with.

The error messages that I am getting are: Warning:

1. Curve.StartPoint expects argument type(s) (Autodesk.DesignScript.Geometry.Curve), but was called with (Autodesk.DesignScript.Geometry.Surface).
2. Warning: Curve.EndPoint expects argument type(s) (Autodesk.DesignScript.Geometry.Curve), but was called with (Autodesk.DesignScript.Geometry.Surface)
3. Warning: AdaptiveComponent.ByPoints operation failed.  
4)Warning: Surface.PerimeterCurves expects argument type(s) (Surface), but was called with (Function).
4. Warning: List.Flatten operation failed
5. Warning: Internal error, please report: Dereferencing a non-pointer.
6. Warning: Internal error, please report: Dereferencing a non-pointer.
7. Warning: AdaptiveComponent.ByPoints operation failed.  
Value cannot be null.  
Parameter name: geometry

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [March 29, 2019, 8:01pm UTC](https://forum.dynamobim.com/t/flatten-1d/34162/6 "2019-03-29T20:01:33Z")

</div>

It would be much easier to tell what’s going on if you could turn on node previews.

If you’re trying to flatten a multi-dimensional list to a 1D list you can use the default value of -1 or ignore the `amt` input all together.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/a/2a129567369e2abae069ca3ac0ad172c3673f000.png)

---

<div class="post-metadata">

**Author:** ![hiatt.kaitlyn](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/hiatt.kaitlyn/32/73640_2.png) [@hiatt.kaitlyn](https://forum.dynamobim.com/u/hiatt.kaitlyn)\
**Post date:** [March 29, 2019, 8:01pm UTC](https://forum.dynamobim.com/t/flatten-1d/34162/7 "2019-03-29T20:01:34Z")

</div>

![ParamTowerScrnShtsmall](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/5/f5f2a5d4f4e6717edcb34c3af29bfd805a1a8bc8.png)

---

<div class="post-metadata">

**Author:** ![hiatt.kaitlyn](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/hiatt.kaitlyn/32/73640_2.png) [@hiatt.kaitlyn](https://forum.dynamobim.com/u/hiatt.kaitlyn)\
**Post date:** [March 29, 2019, 8:03pm UTC](https://forum.dynamobim.com/t/flatten-1d/34162/8 "2019-03-29T20:03:00Z")

</div>

How do I turn on Node Previews?

---

<div class="post-metadata">

**Author:** ![hiatt.kaitlyn](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/hiatt.kaitlyn/32/73640_2.png) [@hiatt.kaitlyn](https://forum.dynamobim.com/u/hiatt.kaitlyn)\
**Post date:** [March 29, 2019, 8:04pm UTC](https://forum.dynamobim.com/t/flatten-1d/34162/9 "2019-03-29T20:04:45Z")

</div>

-1 Might help let me try that!!

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [March 29, 2019, 8:04pm UTC](https://forum.dynamobim.com/t/flatten-1d/34162/10 "2019-03-29T20:04:47Z")

</div>

Hover over a node and “pin” the dropdown preview.  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/7/b7e2be14c485cd9d155b000990591bda44a759ab.png)

---

<div class="post-metadata">

**Author:** ![hiatt.kaitlyn](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/hiatt.kaitlyn/32/73640_2.png) [@hiatt.kaitlyn](https://forum.dynamobim.com/u/hiatt.kaitlyn)\
**Post date:** [March 29, 2019, 8:05pm UTC](https://forum.dynamobim.com/t/flatten-1d/34162/11 "2019-03-29T20:05:36Z")

</div>

Ohhhh! That’s what that is!  
You are AWESOME!

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [March 29, 2019, 8:11pm UTC](https://forum.dynamobim.com/t/flatten-1d/34162/12 "2019-03-29T20:11:34Z")

</div>

![2019-03-29_15-07-43](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/f/ff6eb641a580b674cbc81c16d57ee96071d74a78.gif)  
Try playing around with different numbers to see if the amount input makes sense. The node now flattens from the outside, so you flatten @L5, @L4, etc with each interval. You can eventually flatten down to a singular list in this way or you can use -1 to to a full flatten. (0 doesn’t flatten the list at all.)

---

<div class="post-metadata">

**Author:** ![hiatt.kaitlyn](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/hiatt.kaitlyn/32/73640_2.png) [@hiatt.kaitlyn](https://forum.dynamobim.com/u/hiatt.kaitlyn)\
**Post date:** [March 29, 2019, 8:13pm UTC](https://forum.dynamobim.com/t/flatten-1d/34162/13 "2019-03-29T20:13:42Z")

</div>

I will play around with it a bit and see what happens. Thank you!

---

<div class="post-metadata">

**Author:** ![hiatt.kaitlyn](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/hiatt.kaitlyn/32/73640_2.png) [@hiatt.kaitlyn](https://forum.dynamobim.com/u/hiatt.kaitlyn)\
**Post date:** [March 29, 2019, 9:14pm UTC](https://forum.dynamobim.com/t/flatten-1d/34162/14 "2019-03-29T21:14:42Z")

</div>

![ParamTowerScrnShtleft1](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/2/92d07d0d99fdfffd25409af462bf496d4a1b35e0.png)  
So this is the same project but with the -1 code block. I tried a number slider and it gave me the same errors as before.

---

<div class="post-metadata">

**Author:** ![hiatt.kaitlyn](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/hiatt.kaitlyn/32/73640_2.png) [@hiatt.kaitlyn](https://forum.dynamobim.com/u/hiatt.kaitlyn)\
**Post date:** [March 29, 2019, 9:16pm UTC](https://forum.dynamobim.com/t/flatten-1d/34162/15 "2019-03-29T21:16:02Z")

</div>

![ParamTowerScrnSht3middle](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/1/31113cb7e8d55e3a895a866492d0c02550e2dad5.png)

---

<div class="post-metadata">

**Author:** ![hiatt.kaitlyn](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/hiatt.kaitlyn/32/73640_2.png) [@hiatt.kaitlyn](https://forum.dynamobim.com/u/hiatt.kaitlyn)\
**Post date:** [March 29, 2019, 9:17pm UTC](https://forum.dynamobim.com/t/flatten-1d/34162/16 "2019-03-29T21:17:11Z")

</div>

![ParamTowerScrnSht3right](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/d/ddc0ab4a1e7a2e03769a4eed4561a3b90596b694.png)

I honestly don’t know what I am doing wrong at this point.

---

<div class="post-metadata">

**Author:** ![Jonathan.Olesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jonathan.olesen/32/44242_2.png) [@Jonathan.Olesen](https://forum.dynamobim.com/u/Jonathan.Olesen)\
**Post date:** [March 29, 2019, 9:19pm UTC](https://forum.dynamobim.com/t/flatten-1d/34162/17 "2019-03-29T21:19:42Z")

</div>

You need to know the difference between a curve and a surface 🙂
