I want to find shortest safefty path from any room to the exit in Revit.
Thus, I plan to divide areas (like rooms, exit, floor, doors) into two-dimensional grids to form vertex or nodes, so that I can apply them in pathfinding algorithm like A*.
I noticed that Revit has provided coordinates in floats number which cannot be used directly, though. Is there some similar functionality which can achieve my plan in Revit API?
If any of you have some tips for me, please help me.
Thank you.
Solved! Go to Solution.
Solved by jeremytammik. Go to Solution.
Here is a Revit add-in that prompts the user to select a model curve representing the optimal exit path:
http://thebuildingcoder.typepad.com/blog/2016/09/hololens-escape-path-waypoint-json-exporter.html
Do you know what a Voronoi diagram is?
It might help generate the optimal path automatically.
Check out Max Thumfart's sample using the C++ Boost library Voronoi implementation in a Revit add-in:
I also was told that Adam Sheather presented an example of wrapping the A* algorithm in a Dynamo node at AU 2016; I don't see it in his material, though:
https://royalexander.wordpress.com/2009/07/07/new-version-a-pathfinding-in-3d/
Regarding tips about handling the Revit floating point coordinates: That is pretty trivial. I suggest that you convert them to millimetres, store those in integer numbers, and base your calculations on that. Then you can convert the results back to the Revit imperial coordinates when needed.
Cheers,
Jeremy
An update on the use of the A* algorithm for pathfinding in a Revit model:
Here is the link to the A* C# library code you can use:
You can use the geometry library in Dynamo or C# to check whether Revit elements intersect with the A* voxel space and use that to blank out that area.
With that in hand, you can specify a box and how many items you want to check against for the pathfinding.
Cheers,
Jeremy
Thank you very much for your reply! The A* for 3D in C# is of great help in my furutre work.
I also found another simple path algorithm using dynamo which extract points in grid. And a Dynamo package called lunch box would find the shortest It will give much inspiration for the pathfinding algorithm.
https://revitbeyondbim.wordpress.com/2017/01/03/fire-exit-risk-assessment-with-revit-and-dynamo/
Terry
Dear Teryy,
Thank you for the link and glad to hear it is looking good.
I look forward very much to hearing how you end up implementing your solution.
Thank you!
Cheers,
Jeremy
I summarised our discussion and added some extra notes here:
Cheers,
Jeremy
Hi,
Boost Your BIM, a software consulting firm, did a project called "Pathfinder" for Stantec that might be of interest. We presented it a BIMForum a few years ago and you can learn more about it at these links:
http://www.globalpres.com/Mediasite/Play/084e3ac57c0848e5b3869db310db1afc1d
Regards
Harry Mattison
Owner, Boost Your BIM
Can't find what you're looking for? Ask the community or share your knowledge.