Apply 2 functions to list

Hi I’m trying to create floor or ceiling plans depending on if its true or false and get the same ordered list after. However I’m not sure how to apply the function to the list. Struggling to explain this one but hopfully my snip below helps. The function apply list should be 24. Never used them before so not sure.

This works but it dosnt work because I’m getting extra views I dont want…

Not as cool but merge bool mask works

Translate the view creation nodes and the If node to a DesignScript codeblock (Node to Code if you’re unfamiliar) and merge everything into a single “line”. That will allow you to control exactly which items get a FloorPlan and which items get a CeilingPlan while maintaining the original list order.

It should look something like this:
isFloorPlan ? CreateFloorPlan(item) : CreateCeilingPlan(item);

4 Likes

Way cooler

Omg how am I just learning this now :rofl: :rofl: :rofl:

1 Like

is this screenshot from the dynamo-primir ?
how can i activate this in dynamo`?

Particularly the codeblock is fancy!

It’s highlighting and right clicking on the white space is the trick to get more options. Years on dynamo and never new. Should really read the how tos

1 Like

For some reason in dynamo 2.16 R23 when I run a 100 levels through it and 100 true or falses flattened. It creates 100 views of each :thinking: although it says its not.

Making it a node stopped the additional floor plan creations

Making it a custom node could change the way the node expects inputs and how the logic is handling lists. You’ll have to show us what everything looks like in the updated node and how it runs.

Seeing as this is now a 2 year old topic, it’s probably best to start a new thread with all the details.