# Moving Element Face to Closest Wall Face

Hey!

So I’m still pretty new to Dynamo but I had an idea that I’m having trouble with finishing:

I want dynamo to look at a room, see the element(s) in a room, identify which wall/perimeter that element is closest to, and then move that object to be against that wall/surface.

So far I can find the closest distance based on the objects face to the perimeters face(see attached) but I keep going down rabbit holes on what will be the best next step to push it against that face.

So far:
-I can move it just fine if I was only looking for its point, but that puts it through the wall sometimes. Really want this to be “back of desk finds nearest wall”.
-I’m curious if there’s an easy way to rebuild this so I can identify the right vectors as opposed to numerical values
-Is there a way I’m missing to keep elements cognizant of the curves they become?

See all attached

Geometry_Placer_2.dyn (22.6 KB)
Move_Me_Test.rvt (1.2 MB)
nal/3X/a/2/a28d1c359c9fd2094f98b8e586f644562b63278f.PNG" width=“690” height=“293”>
P.S. Thanks to @Hyunu_Kim for laying down the ground work for the initial design of this with: http://dynamobim.org/forums/topic/curveloop-from-room-boundaries/

I’m new to Dynamo so I don’t have much to contribute, but this is what I’m trying to achieve as well.

In programming terms, I want to create a loop that select each door of type X, whose reference plane (the edge of the family) is between 0 and 1 foot from the closest parallel wall, and change that dimension to 4".

This could probably be achieved with the same solution you’re looking for.

Sorry for the delayed response; in the middle of switching jobs.

I actually got further with this than I was expecting, but there is a small difference between our two problems (your’s is easier to solve); I’m looking to have Revit look at the geometric extents of the object and the room and pick up on which face is the closest per the relate able, parallel angle and then take that number and reduce it to 0 along that vector. I got some what far, but occasionally with multiple elements the room would start to “pin wheel”.

Yours should be easier because you may not need to look at the geometry or comparative angles and then relate it back, but could identify the placement of the door with the wall and then look for the point of the door VS the extent. At that point you just tell it to take that number (and you can put in a filtering tolerance for identification) and tell it to replace it with what would relate to the dimensions of the door + 4".

I might have sometime to take a small stab at it next week, but look for points and developing relate able properties between the wall and door (first step). Also, identifying the dimensions of the rooms have been a good way of getting round some of the difficulties in establishing relationships and properties.