Opening Edge to Wall Edge distance

Hi,
Is it possible to only get the distance from the opening edge to wall edge and opening edge to opening edge?


Opening Edge to Wall Edge distance .dyn (28.9 KB)

Yes - if you want to get the layout as you have illustrated then look into the dimensioning workflows.

If you just want to do a geometric analysis then Instead of using element.children and bounding boxes I recommend you use the geometry of the wall.

  1. The Revit API has some methods to get the inside or outside face of a wall, which you can then convert to Dynamo geometry.
  2. Edges can then be filtered by the Z component of their direction - anything primarily vertical will need a measurement for your horizontal distance study.
  3. Sort the lines by their relative parameter along the walls’s location curve to assure lines are ordered from wall start to wall end.
  4. For each line excepting the final line:
    1. Get the nearest point on the line to the next line.
    2. Get the nearest point on the next line to the line.
    3. Build a vector between the two points.
    4. Extract the XY component and get the length - this is the horizontal distance between the components.
    5. Write out the horizontal distances.

Note that you might want to group stuff by inclusion in a common vertical range between step 3 and 4. I won’t go into the logic for that as those steps won’t help if you don’t manage the base steps first.

Give it a shot and see where you get.

Hi @jacob.small, the distance is resulting 0. I’m not sure what I’m doing wrong.


Opening Edge to Wall Edge distance .dyn (37.6 KB)

Look at how many items you have at each step. For a basic wall there are at least four surfaces which have a normal with a z component of 0 - the front face, the back face, the left side, and the right side.

You need to get either the front or back face.

As a side note, you appear to be using an antique for all of this work. Revit 2022 isn’t supported, and you’re going to be spending a LOT of time maintaining the antique and the supported builds. Time to update.