Flatten-1D

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.

WhatTheNode from Rhythm can be very helpful for determining the package of a specific node.
image

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

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

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.

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

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.

How do I turn on Node Previews?

-1 Might help let me try that!!

Hover over a node and “pin” the dropdown preview.
image

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


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.)

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


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.

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

You need to know the difference between a curve and a surface :slight_smile: