Draw ShortestWalk routes on the surface

Hi, all

I saw a post about the drawing Escape Routes below.

I would like to apply this method to my project.

There are surface and the foundations under the surface in my Revit file.

I drew the mesh on the surface except for foundation area and put 2 small masses on the surface which are Entrance and Exit point.

I want to draw the shortest walk route as the post did using ‘Curves.ShortestWalk’ node.

However, it didn’t work. The detailed errors are below.
image

Anyone who used ‘Curves.ShortestWalk’ nodes and have those kind of problems before?

What would be the point of that Code Block with “AnalysisGrid” in it?

Hi,

This is a list of lines.

Yes.
But that is the exact same of what comes out of the List.Flatten node.

Yes, I just follow the blog post.

Even though I don’t use this code block, the result is same :frowning:

have you tried with a smaller dataset, it can be difficult to identify errors when you have to look through 8866 curves / lengths :slight_smile:

I know, I wondered if you expected that node to do something.

I tried finding the uniqueitems, and then sorting (just to get an overview) and there are “null” values in there which causes the error.
The “null” values are on index: 1134, 3666, 3674 and 7776

These could occur if the curve/line you are trying to find the length of has a length of zero (if startpoint and endpoints are at the same location)

In this case the indexes contain points and not lines (and the error thus happen) my guess is that this is the corner points of your “grid”

1 Like

My guess as to the current error might be that the node is not yet updated to Dyn 2.0 :slight_smile:
Though you do get the polycurve containing the shortest walk.

2 Likes

Hi, Jonathan.

Wow, finally got the solution. that was the problem.

Thank you for comments! :slight_smile:

In my experience, that’s an “already”.:yum:

1 Like

“Already” < 2 Hours
“Finally” > 2 Hours

:stuck_out_tongue:

Great that it worked for you, the solution is not perfect as it might be smarter to filter out the points rather than filtering “in” the lines, this would allow for polycurves to also be passed and “used”. :slight_smile:

Note that the previous node had the preview disabled. I have used this to pull the list and geometry preview further along in the graph, allowing me to turn the background preview on and off as needed. The joy of instant and periodic feedback. :slight_smile:

Aha, well, I didn’t know that.
But the Watch node still exists, which I often find more comfortable to use than the regular previews.

Sometimes I use that too. But it lacks the ability to shrink down nice and compact - Incase you couldn’t tell from looking at other stuff I’ve posted I like small and well aligned nodes. I’m kinda OCD about it to a fault (“ah the bottom of this code block node would align with the bottom of that node without hiding that wire if I swapped it out for a string node!” begins to trade out all code blocks containing single strings)

1 Like

I know the feeling. I had this massive graph where every node would be centered properly in the smalles number of background squares I could fit them in.
…and then I finally managed to update my Dynamo version and everything started to overlap. I will also refuse to ever have a line going backwards.

I do think it’s very important to keep everything nice and tidy simply for the sake of clarity. Thinks can get messy very fast.
And ometimes you just end up with this:


ugh

1 Like

Personally I prefer making it work, and then going back and simplifying as much as possible, if I can fit a large workflow into a codeblock or a python-node then I’m very happy as I do also like to keep it tidy without turning the graph into a black box :slight_smile:

1 Like

Absolutely. Making it work is a priority but after a bit is done I always go back to clean it up.
I particularly hate needing massively long lists with strings in code blocks (often parameter names and alike) so I recently started doing these kind of things:


I’m not sure whether I should be proud or ashamed.

1 Like

I would probably do something likewise, though build it up to be easier to change upon, if my lengths change :slight_smile:

But then again, I’ve only been on the forum for 3.5 months and using dynamo for approximately 8, so there might be way better methods of achieving the same results. :slight_smile:

1 Like

I will be using that.:wink: