Get Room Boundary.

Get Room Boundary.

Anonymous
Not applicable
2,334 Views
4 Replies
Message 1 of 5

Get Room Boundary.

Anonymous
Not applicable

Hello Everyone .

i want to get the Location point of Room Boundary Walls.

i don't know where to start ..can anyone give me some hints..

pls help.

0 Likes
2,335 Views
4 Replies
Replies (4)
Message 2 of 5

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi @Anonymous ,

try using this link

Room-and-wall-adjacency


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 5

Anonymous
Not applicable

Thankyou  

BoundarySegmentArrayArray 

 

0 Likes
Message 4 of 5

BenoitE&A
Collaborator
Collaborator

Hi,

A Room can have multiple loops in its contour, for example if you consider a room with a hole in the middle (duct). 

So the room contour is an Array of Arrays of Boundary Segments :

- first array : consider the different loops (for example loop 1 : the exterior contour of your room - loop2 : the contour of the duct)

- second array : consider one closed loop and get every item of it.

- Boundary Segments : one piece of a contour containing mainly a Curve and Id of the element that creates it.

If you want to access the boundary segments of the first loop : 

foreach(BoundarySegment bs in myRoom.GetBoundarySegments()[0])

{

}


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

Anonymous
Not applicable

Thankyou  BenoitE&A for reply.

I try this.

for each(Element ^element in collector)
{
Room ^room = (Room^)element;
IList<IList<BoundarySegment^>^>^ bsArr = room->GetBoundarySegments(gcnew SpatialElementBoundaryOptions());
for each(BoundarySegment ^bs in bsArr[0])
{
       bs->Element;/////Error
}
}

 

again Same Problem that BoundarySegment in not available after Revit 2015.

http://www.revitapidocs.com/2018/acf05037-5c49-9983-09d1-8d2eceed7c55.htm

 

and i try to cast the 'bs' into Element and Wall class but gives exception InvalidCastException.

pls help.

0 Likes