Thoughts on obtaining room perimeter less doors

Thoughts on obtaining room perimeter less doors

Kevin.Bell
Advisor Advisor
2,050 Views
10 Replies
Message 1 of 11

Thoughts on obtaining room perimeter less doors

Kevin.Bell
Advisor
Advisor

Hi,

 

I'm hoping for some advise on the best way of obtaining a rooms perimeter lines, less the doors.

 

I can easily get the rooms perimeter curves using Room.GetBoundarySegment, but this returns the whole perimeter ignoring the doors.

 

I'd like to obtain the boundary lines but somehow subtract the doors from the lines.

 

Any thoughts on how to achieve this?

 

Thanks,

0 Likes
2,051 Views
10 Replies
Replies (10)
Message 2 of 11

Anonymous
Not applicable

Can you use the walls instead? The Room class has a property called "ClosedShell" . You will have to cast it into a GeometryElement. Then from this point on you should be able to get the "Solid". Don't forget to compute references!!!HA!

 

GeometryElement  geometryElement = Room.ClosedShell;

 

0 Likes
Message 3 of 11

Kevin.Bell
Advisor
Advisor

Thanks, I did look at ClosedShell, whilst I can get a 3D shape of the room from this, it ignores the doors...

 

I did wonder if I could obtain the perimeter room lines and then subtract the door 3D volumes from the lines...

0 Likes
Message 4 of 11

BenoitE&A
Collaborator
Collaborator

Hi,

If you use only Rooms in your model than the FromRoom and ToRoom parameters of the Door object are your friends. If not (if you use also Spaces) than you will have to create a specific method to retrieve Doors from a Room/Space. But it can be done pretty easily.

Once you have the doors you can find the portion of curve that corresponds to the Door and substract it to the Room boundary segments. To achieve this we found most efficient to go through the Geometry of the Host Wall of the door, find the vertical edges corresponding to the door and compute which are the "good" ones.

About 1 to 2 days work with debugging...

Hope this helps


Benoit FAVRE
CEO of etudes & automates
www.etudesetautomates.com/
0 Likes
Message 5 of 11

Kevin.Bell
Advisor
Advisor

Thats interesting - are there any methods for obtaining the walls that bound a room from the room element?

 

Cheers.

0 Likes
Message 6 of 11

BenoitE&A
Collaborator
Collaborator

Yep.

myRoom.GetBoundarySegments() returns the boundary segments of the room which are the combination Curve creating the boundary and ElementId which will be in most cases the wall you are searching for (but it can also be a room separator or anything that encloses a room)


Benoit FAVRE
CEO of etudes & automates
www.etudesetautomates.com/
0 Likes
Message 7 of 11

Kevin.Bell
Advisor
Advisor

Excellent - thanks for your advise. That sounds doable...

 

I didn't appreciate that BoundarySegements returned the ID of the wall creating them, its a shame it doesn't return the doors, though I can get I can query the To and From parameters to find the room.

 

Cheers.

0 Likes
Message 8 of 11

sgermanoZ2Y2F
Enthusiast
Enthusiast

Hi I am looking to do the exact same thing, any luck with getting this to work. Appreciate any code you would like to share on removing the doors from the boundarysegments lines.

0 Likes
Message 9 of 11

Kevin.Bell
Advisor
Advisor

No, I didn't make any progress.

 

I think to do this, you need to work out the doors 'manually', so get the room perimeter, then get the walls bounding the room and the check the walls for inserted doors... something like that.

 

Best of luck!

0 Likes
Message 10 of 11

Anonymous
Not applicable

You can use the room perimeter from the room class. 

Get all doors in the model, they have room from and room to 

Loop through each room subtract the length of each door that has the room in the room from or room to parameter

 

0 Likes
Message 11 of 11

BenoitE&A
Collaborator
Collaborator

Hi,

Here is what I have done before :

Use myRoom.GetBoundarySegments() which retrieves the walls (and other stuff like separators)

Close your Loop by checking that at each End of a Curve the next Curve is beginning. Generate the missing segments if needed. (there are some cases in which the BoundarySegment list is incomplete, for example when you have the edge of a wall or in the case of roofs)

Use a FilteredElementCollector to get all the Doors of the level. 

If your FromRoom/ToRoom parameters are completed you can use them to get the Doors you are interested in.

Anyway you have to localize your Door, which is tricky but doable (use its Host Geometry). You should get something like a segment to describe their location in the plane.

Once you have found the Doors which are close to your Room, project their location on your Loop and take this segment off your loop.

 

Not that simple though...

Just a question: what for?


Benoit FAVRE
CEO of etudes & automates
www.etudesetautomates.com/
0 Likes