Room centers to bottom left problem

Hey everyone, I’ve been stuck on improving my script.

I created a script that detects the most bottom left corner of a room (as per office standard). It evaluates the two points closest to the bounding box min point.
If the closest point is within 10mm of the min point, it will ignore the 2nd point. This makes sense for rectangular rooms etc.
However for triangle or pentagonal shaped rooms it moves the center point out of the room.
I thought of doing a polygon.containment test and seperating the y and x values. Then grabbing the ones it need to adjust for sharp corners. This is where I am stuck however.

So my question is, can I evaluate the corner the Room Boundary curves make, based on the two points that are closest to the min point?
Or perhaps there is an easier method to apply the polygon.containment test.
image

03.1_SEL_Rooms.Linksonder_V3.dyn (109.8 KB)

Why not the outermost bounding curves of the room, offset by a small negative value, extract the points, and get the closest point to the min point?

So wait, you’re saying make a smaller version of the same room and use its bounding min point instead? That’s genius!

Not sure I’d go that far, but yes. If you want your point 10mm off a corner, I would start by getting all points 10mm off a corner and filter from there.

I don’t agree with that location point as a standard though - too easy to have a room wind up in a wall or outside of the room boundaries.

Alright I have tested this a bunch and I think the offsetting the polycurve really helped me get unstuck. Unfortunately the Room boundaries themselves are detected differently depending on the amount of rooms grabbed with the Select Model Elements by Category node.

I thought it was a lacing problem but it’s not. Some rooms are a little too custom for this script regardless so I split it up into two scripts. One doing the best it can with offsetting the Room Points. Then another aligning all Room points on approximately the same Y coordinate after manual adjustment

Revit has a built in tool to allow finding what is often the ‘center’ of a room, which may make a bit more sense. Currently you are fighting to find the lower left corner which often doesn’t make sense (ie: if the room was shape like this (paste the code below into a code block), which is the lower left corner?).

PolyCurve.ByThickeningCurveNormal(PolyCurve.ByPoints(Point.ByCoordinates([10,10,0],[0,10,10]),false),2,Vector.ZAxis());

Alternatively you can get the PlanTopology at a given level and phase, get the circuits from that, iterate over the circuits to get a point in each one, find the room at that point, and move the room’s location accordingly.

since we mostly design swimming pools, it doesn’t make much sense to make the rooms in the middle. As then you get the pool and it’s platform aligned into same point, glitching the platform room.

So you can disagree to that drawing style all you want but it’s not going to change.

right now it is only buggy with the corners smaller than 90 degrees and corners where the bottom left corner is cut out.

For the latter, I correct it with the 2nd script where it looks to rooms with a similar bounding box min point Y coordination.

I’m just finding a problem between Dynamo and Revit, where Revit finds and completes a Room but Dynamo returns a null when trying to obtain the boundaries. It often has to do with how the boundaries were made and whether they form a perfectly closing loop. But it still makes Dynamo very inflexible to deal with this situation.

Not sure I understand as I am not sure what is meant between ‘pool and platform’ as no two rooms can share the same cell in plan, but I do get the point about limitations - rooms aren’t always ideal for what we need to do.

For your geometry situation, can you post an example model of what is failing to the forum? It’s likely that there is one of two things going on (or a combination of the two):

  1. The complexities of the model are dictating a more precise method for getting the curves.
  2. Modeling methods and standards aren’t being met, and need to be revised to ensure that automations can scale.

Not sure I understand as I am not sure what is meant between ‘pool and platform’ as no two rooms can

Exactly so having the platform room jump to the center will move it out of bounds and put it in the same center as the pool

Ah! “Center” in this context is a point on the armature of the room itself. A 'U shaped room or a donut shaped room will pick a point inside the cell but consistently derived, never in the void. :slight_smile:

Happy to check on the room geometry if you’ve got something you can share.

Oke great, new day so new approach to this.

I just ran the script again and this was the result:


This is what happens when I run my script based on selecting all rooms in view of the ground floorplan

This makes sense after I set the offset from the Bounding Box Min Point, I group all resulted Y points within a 300mm margin and set all Y points onto the same.
Then it jumps out of the room. I probably have to do something with vectors instead of just moving the Y coordinate up.

I also refer to my first post where you can see the room piercing through a Room Bounding Wall. This had to do with the relative heights.

So just checking my own work has already revealed a lot. But I think 70% of the fix has been your suggestion using the offset of the crop. (It just doesn’t always find the Room Boundaries :confused: )

Need a model to reproduce this in order to help.

As noted before it’s likely that there is one of two things going on (or a combination of the two):

  1. The complexities of the model are dictating a more precise method for getting the curves.
  2. Modeling methods and standards aren’t being met, and need to be revised to ensure that automations can scale.