Hello all. I am new to Dynamo (2nd week) and a beginner at Python but I was tasked with creating a script that would check for head clearance on specifically ramps. I couldn’t find anything similar so I finally made a version to work but am looking for any feedback on a way to make it simpler or less processing intensive. I am sure my graph is riddled with mistakes or pet peeves to other programmers, but I would really appreciate any info. If this is inappropriate here or there are any issues, please let me know and I will take it down. Thank you.
heightCheckRamp_test.dyn (302.9 KB)
Currently it only works if there is more than 1 ramp in the drawing and haven’t done a full test on how it reacts to linked files. It is also in metric and uses Revit 2016 and Dynamo 1.3.2, with the LunchBox for Dynamo package.
Below I will try to list my reasoning for the methods I chose if you care to read:
The first idea was to create an extrusion and look for any solid intersections but with ramps that curve in x, y, and z, the extrusions between two ramps next to each other left gaps and couldn’t be used. Next idea was for a grid of points with ray tracing to look for interference points, which is what I ultimately did. I know that this will not scale well and doesn’t behave that great when ramp pieces can largely vary in size. To get the grid, I found the top surface of the ramp and used LunchBox’s DivideSurfaceUV to create a UV grid along the surface.
Unfortunately, the grid goes outside the surface when it is of an irregular shape, so the next chunk of nodes tries to eliminate points that do not fall on the surface. This is done by translating up, then shooting down and if it hits the correct floor, it keeps the point. Admittedly, there are a lot of issues with this step and would love to know of a better alternative.
After that, it is a simple raytrace up, if it hits something, it saves the point. If the hit point is within a distance less than a certain amount from the origin point, it creates a filled region on a floor plan, to let the user know there is a clearance issue there.