Door Offset from adjacent walls

revit

#1

Please help me achieve this and learn dynamo.
I am looking into creating a process to computationally set door offset from adjacent walls. I need your help understanding some of the logic. I don’t know how some of the dynamo nodes actually work.

Attached below is my first attempt.
Here is the logic I am following:

  1. Find all the walls (Level filtered later)
  2. Find all the doors and the walls that host them.
  3. Determine the walls that are connected to the wall that is hosting the door.
  4. Determine the distance from those connected walls to the door.
  5. Pick the shortest distance. Do the math calculating the wall widths, and distance to the center of the door.
  6. Move the door toward the wall with the desired offset value.

I am stuck with the node, Geometry.DistanceTo. This is producing exact same values from two doors that are hosted in a single wall. I was hoping the distance would be calculated from the location point of each door which should yield different values.

Please advise! Thank you!

Door Offset from Walls.dyn (15.0 KB)
DoorOffsetFromAdjacentWalls.rvt (2.6 MB)


#2

Here is an update! I was finally able to determine the closest wall to each door. Now the challenge is to move the door closer to that wall at a given distance. I will keep working. If you have suggestions please do so.
Attached is the updated Dynamo file. The @Levels helps structure list a whole lot better.

Door Offset from Walls.dyn (23.8 KB)


#3

Made further updates. I am beginning to getting too complex. Figuring out a process to reverse vector direction based on positive or negative value is getting tricky. If someone wants to help out please do so.

The file attached is the process so far.

Door Offset from Walls.dyn (44.1 KB)


#4

It would be easier to understand with a screenshot, could you send one?


#5


#6

This could be done with If, < and Vector.Reverse nodes


#7

Do you really need to reverse the vector if you have a negative distance? Moving an element 3 on the Z axis vector will move it up 3 units. Moving the same element -3 units on the Z axis will move t down 3 units.


#8

Well apparently, I am still searching for an easy way to resolve this. So far here is the strategy. Attached Revit Model and Dynamo file that explains my problem. I am having difficulty with Indices of list within a list for values in a list. Attached image hopefully explains what I am having difficulty with. All my lists indices are coming as empty lists. Please advise!

Door Offset from Walls_v02.dyn (31.1 KB)
DoorOffsetFromWalls_Upload.rvt (2.8 MB)


#9

Finally! The script is in working order. Try it yourself! Below is the dyn file and Revit (2018) sample for you to test on. See if you can use it for spurring other ideas. Thank you!

Door Offset from Walls_v03.dyn (51.4 KB)
DoorOffsetFromWalls_Upload.rvt (2.8 MB)


#10

Thank you Yna_Db!


#11

I was looking at your script…nice work…I have to make some suggestions after testing.

  1. add a filter for nested elements
  2. filter out non-wall hosted doors
  3. Curtain Wall Doors do not have a location
  4. the cross lacing for wall intersection is a brutal time suck. I will attempt to filter walls before the intersection check to speed it up.

#12

my for now final


#13

Adam! I was wondering if you could upload your version of Dynamo file so we all can learn more. Thanks!