Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

room boundaries from room.ClosedShell() or room.GetBoundarySegments

12 REPLIES 12
SOLVED
Reply
Message 1 of 13
Ning_Zhou
3475 Views, 12 Replies

room boundaries from room.ClosedShell() or room.GetBoundarySegments

seems boundaries are always from the wall finish faces while it's actually based on wall center line, is it known bug? any workaround?

12 REPLIES 12
Message 2 of 13
JimJia
in reply to: Ning_Zhou

Dear Ning_Zhou,

I do not think the boundaries should be based on wall center, it is based on the finish faces.

 

If you want to get the wall center boundaries, you should do it manually.


Jim Jia
Autodesk Forge Evangelist
https://forge.autodesk.com
Developer Technical Services
Autodesk Developer Network
Email: Jim.Jia@autodesk.com
Message 3 of 13
BenoitE&A
in reply to: JimJia

Hey,

Indeed the room boundaries are based on the finish face. 

And in fact it is a bit more complex, since you have doors and windows and roofs, etc... which produce their own boundaries.

You can also have holes in the boundaries, which is funny (example : a wall such as the attached picture, the room boundaries are in red and the end of the wall is not found as boundary).

Maybe if you explain more why this is a problem to you we can help you more.

Benoit


Benoit FAVRE
CEO of etudes & automates
www.etudesetautomates.com/
Message 4 of 13
Ning_Zhou
in reply to: JimJia

thanks Jim Jia,

from Capture 1.JPG, you can clearly see that room aligns w/ wall center, because i set Room Area Computation to At wall center.

i think at least room.ClosedShell() should base on REAL room which is wall center line, room.GetBoundarySegments may base on physical bounding element which is wall interior finish face.

Message 5 of 13
Ning_Zhou
in reply to: BenoitE&A

thanks Benoit,

Revit export gbXML via room is based on wall center line no matter what setting in Room Area Computation, i create 3D room just for checking purpose.

any workaround will be very much appreciated.

Message 6 of 13
Ning_Zhou
in reply to: Ning_Zhou
Message 7 of 13
BenoitE&A
in reply to: Ning_Zhou

If you want the wall center line (which is a part of the LocationCurve of the wall, if your wall is only one level high) you can always

- get the wall id using room.GetBoundarySegments

- get its LocationCurve

- find the intersection between 2 consecutive LocationCurves and shorten them (using Curve.MakeBound)

But it is going to be long and painful...


Benoit FAVRE
CEO of etudes & automates
www.etudesetautomates.com/
Message 8 of 13
Ning_Zhou
in reply to: BenoitE&A

thanks Benoit, yes, it's painful, besides, how to deal w/ non-horizontal (sloped, stepped, etc) top (sometimes base) constrain of the room?

Message 9 of 13
BenoitE&A
in reply to: Ning_Zhou

Top is not a problem since the LocationCurve seems to be computed at the bottom level of the wall (at least that's the only case I have seen).

Bottom looks more like a pain... but it actually occurs not often.

In any case what I do is project the LocationCurve into the level in which I work, because you always have 1 or 2 walls (espacially for service ducts) that span on 2 or more levels. And I get the level of work using the level associated with the current Room.

I don't know if that can help you...


Benoit FAVRE
CEO of etudes & automates
www.etudesetautomates.com/
Message 10 of 13
Ning_Zhou
in reply to: BenoitE&A

for instance, seating above and under (_room 1, storage), pic at right is 3D room created based on interior finish face

Capture.PNGCapturex.PNG

Message 11 of 13
BenoitE&A
in reply to: Ning_Zhou

Haha looks like a math demonstration in high school :). In French it s called "par l'absurde".

If you find an invalid example it means that my proposition is wrong. Well actually it remains true 99,5% of time, ahah.

Still your example interests me : is Revit able to create a Room and compute its area? Based on what level?

Then indeed we will close this topic.

Benoit


Benoit FAVRE
CEO of etudes & automates
www.etudesetautomates.com/
Message 12 of 13
Ning_Zhou
in reply to: BenoitE&A

yes, your proposition is valid in most cases, seems Revit API (and Dynamo) don't have option to create room based on center line, have to do it manually as suggested by you and Autodesk support.

yes, Revit is able to create room and compute area/volume based on level, in my case, i have to use duplicate level workaround: https://www.revitforum.org/architecture-general-revit-questions/38049-sloped-room-space.html

but strangely Revit gbXML export function will export Revit room based on center line (at least for wall, not sure about other bounding elements) no matter what setting? don't know any logic or magic behind it?

thanks Benoit for your help.

Message 13 of 13
rhanzlick
in reply to: Ning_Zhou

I realize this is an old topic, and not sure if you found an answer. However, it looks like you may be able to achieve what you like in the argument of the method:

 

room.GetBoundarySegments(SpatialElementBoundaryOptions options)

ie. the SpatialElementBoundaryOptions contains an enum that allows you to choose which boundary location you'd like:

https://www.revitapidocs.com/2022/47e2311e-a363-7c6f-560d-cd7033251bbf.htm

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community