fredag 6. januar 2017

Ammo: Shortest Path on Topography

I got inspired by three guys this week on Twitter.

First up was Dieter Vermeulen which tweeted this: https://twitter.com/BIM4Struc/status/816283589969068032

Then Zach Kron followed up with this: https://twitter.com/ZachKron/status/817088565570129921

And lastly, but not least, the man responsible for the crucial part in both of the above examples, Mr Nathan Miller over at Proving Ground for bringing over a port to Dynamo from Giulio Piacentino work over at Mcneel and Associates.

And so I will add yet another example to using the Shortest Walk node in the Lunchbox library:

How to get down from a mountain. Fast..


So what I've done is just placing two site components and using them to find the shortest path between them.

The script in its entirety:


As I stated, "Lunchbox" is needed and the almighty "spring nodes" of course.

onsdag 14. desember 2016

Ammo: Centre of Gravity

A challenge arose some days ago as to define a script that could calculate the Centre of Gravity in a Revit model, and of course Dynamo was made for solving these kinds of challenges. Based on the "Algorithm" found here, we applied it to three dimensions in Dynamo. The script uses project base point as Datum and no particular effort has been made to make the units in the calculation usable for anything else. The python script has however been modified to extract density in SI units.

Enjoy! :)



In action:


A version of the script can be found here

torsdag 17. november 2016

Ammo: Sliding Windows - Python tip of the day

Just a quick Python tip of the day.

I regularly find my self in the position of needing to slice lists with "sliding windows"

Like if I have the list {1,2,3,4,5,6,7,8} I would like to return {{1,2},{2,3},{3,4}..etc}

Just found this great way of doing it in dynamo. (I'm sure there are many ways of doing it, but quite simple this one anyways.)