Nested If Logic

Hello everyone.
I need to proceed two different functions with two different elements in the one list.
In my case I have lines and arcs. From Lines I need to get a start point only, from arcs i need to get Curve.Point at parameter (0, 0.3, 0.6, 0.9). Ultimately I need to get a list of points in the same order as they came from an origin list. The Node If doesn’t work at levels. But I have found such node From Zebra package. But still that node have an issue with levels matching. Does any body have any ideas how can I get the right result ?

I think that list If can do it since I have true and false Boolean mask.
So in another words I need to get in place of arcs 4 points and in place of lines I need only 1 point.
Or maybe there is a way how you use it with Dictionary ?

Hmm… If I interpret your problem correctly, I believe this works? You’ll need the RIE package and to set your geometry range to large…

There will be many other (bettter) ways of doing it…

LinesArcsPoints.dyn (17.5 KB)

Hope that helps,

Mark

Hello Mark
Thanks for the idea, but I believe that this will not work since I need to get eventually a closed poly curve. My source of arcs and lines is Rooms boundaries. Unfortunately, because of high complexity of room shapes I can not use the Nod Element.Geometry. Dynamo simply crush with it. So i need to simplify it in order to get Solids that describes Rooms. So back to the curves origin… I need to remain the order of curve elements that are converted to points. Arc to 4 points, Line to 1 point. After I will do the closed poly curves from the list of points, surface.patch —> extrude …
But the issue how to convert all elements and maintaining the order of Origin.
To be honest I just achieved some result in this. But I believe that there is can be totally new concept of approach. With nod If, or dictionaries

Hey,

Apologies if I’ve misunderstood.

The problem with using group by key is that you have not identified the order.

If you look at my graph you will note the use of Index Of (true) to identify the order, then the use of Insert to recreate the ‘order of curve elements’.

Perhaps you could clarify why this is not what you wanted? Perhaps uploading a dyn and rvt with what you want highlighted will help.

Cheers,

Mark

Okey, List.Insert is an interesting way. But it works when you have two equal size lists (equal quantity of lines and arcs). Why did you use RIE package for Index of, what the benefit? We have a Basic one List.AllIndicesOf. It gives the same result.

My ‘index of’ just returns the first index, not a list, unlike the RIE, if yours works for you, that’s great. But your flatten node is showing a warning? I’d have a look and see what’s going on there before reviewing down the line.

With a more varied list, my ‘insert’ also fails, so I’d use the RIE version there as well…

Hope that helps,

Mark

Mister Mark,
I will check it a bit later. But From the result on the picture I already can see that it works.
And please see the Dynamo system node
image

1 Like

Thanks for that, no need for the ‘Mister’ :slight_smile: good luck!