Script for elements with variable height parameter

Hi there, I am new here and in dynamo world in general, so I apologize in advance if I misunderstand myself or if I waste someone’s time, my situation is as follows:

I have to model a stretch of highway in revit where there are many viaducts.
Road slabs are created in families with adaptive points and placed in georeferenced points in the model.
In the model then I created the various abutments and pillars where the slabs will rest (using families).
The junction between the shoulders / pillars and the slab is made up of supports (just like those in the photo I am attaching);


resting on the various pillars or shoulders they will then develop in height until they meet the slab (being the various slabs inclined each support will therefore have a different height).
I created the family of the supports with height as an instance parameter (named “Altezza”), which however must be entered manually for each single unit as they all have different heights.

Since the are several hundreds of these supports, the operation would be eternal and, also considering the probable possibility of changes to the blueprints, cause of errors.
So I decided to automate this step with a dynamo script.

I sketched one where I plan to:

  • select the elements from the model and then the height parameter (named “Altezza”) to be able to give them the different values
  • take the point on the slab where it intersects with the axis of the supports (to be able to subsequently place it as the Z point in the single support)

I think I succeeded in the first part but in the second I’m stucked … and I’m afraid it’s not the right way to work.

I tried to search here or on the web for a script that would allow me to set the height parameter “until it touches something” (which is what I actually need) but I didn’t find anything …

Anyone have examples of scripts that allow this or similar or any kind of advice? Thank you

Giacomo, Italy

this is the script i drafted, pkease don’t judge :’)

Without seeing the project and the elements involved, it looks like you’re going to want to pull the geometry from the highway with the Element.Geometry node. You’ll likely have to filter through this to find the exact pieces of geometry you need.
For the family, however, you might be able to use Element.GetLocation - this will probably output the insertion point of your family. From there I’d try and do something like this: Project points into surface topography problem - #4 by felipe.mateus96

2 Likes