Floors by rooms including threshold of doors

Hi
I’m trying to make a script that create floors by rooms and extend the floor to underneath the middle of the threshold of the door from each room. But right now i’m just trying to get it to work from one side-

I have been looking at https://forum.dynamobim.com/t/selecting-doors-and-windows-from-room-x-to-room-y/40577/43

And i’m trying to edit the script made by @jacob.small / @Laura_BIMChick.

I have managed to edit the size of my “surface patch” underneath the doors.
But i’m having a lot of trouble getting it to offset correctly based on the doors placement.

I have tried offsetting the the coordinate system by a given distance using (CoordinateSystem.Translate), but it only works correctly on one of the doors.

With the other doors it shifts in other directions.
I think its because i only offset in the x-axis.
So i know it’s not working because it dosen’t move it based on the doors coordinate system, but the model.
See the doors here

A i working correctly

B & C is offsetning wrongly

I’m not used to working with geomtry and coordinates in dynamo yet, so if some could point me in the right direction i would be grateful.

Included is the test script and test file.

FloorByRoomTest_edit.dyn (238.4 KB)

Test_file.rvt (3.2 MB)

b

Ended up solving it myself, just needed to connect FamilyInstance.FacingOrientation to the “CoordinateSystem.Translate” direction posted it hear in case anybody need the same

Hey @Henrik ,
Sorry for my late reply, have been super busy lately.
I saw you already solved your problem but I would still like to share with you my latest version of the script which works pretty good for our company.

FL_FloorFinishByRoom.dyn (352.4 KB)