Bounding box issue

Hello all,

My definition gets the bounding box of the rooms but fails to get the perimeter curves of the bounding box…

For some reason the Clockwork node yields empty…

Cant think of a reason?

Is it the plane that i am feeding it ? (associated level)?

Any ideas very much appreciated.

Levels and rooms are fine on the architects model yet it can create curves from the bounding box…?

Did you check that the bounding boxes and the level intersect as indicated in the node description?

What do you mean? They are placed on the level- therefore it identifies the rooms?

I was just thinking that there could be an offset due to the slab thickness that could create a void between elements

Good point.

The room has no offset though from the base level i use

Is there any other way to get the perimeter curves of the bounding box?

You could try it with Geometry.Intersect, it works with planes, but I would slightly move the solids down first to make sure that they really intersect with the plane

@i.tzivanidis if i understand your question correctly, what you want is perimeter curves of each room(room boundingbox) right? So, here some help.

You can copy/paste from here,

import clr
clr.AddReference("RevitAPI");
clr.AddReference("RevitNodes")

import Autodesk, Revit;
clr.ImportExtensions(Revit.Elements);
clr.ImportExtensions(Revit.GeometryConversion);
from Autodesk.Revit.DB import *

rooms = UnwrapElement(IN[0]);
result =[];

for room in rooms:
	opts = SpatialElementBoundaryOptions();
	opts.SpatialElementBoundaryLocation = SpatialElementBoundaryLocation.Finish;
	crvs = [];
	for seg in room.GetBoundarySegments(opts)[0]:
		crv = seg.GetCurve();
		crvs.append(Revit.GeometryConversion.RevitToProtoCurve.ToProtoType( crv, True ));

	result.append(crvs)
OUT = result;
1 Like

Could you tell us where does this code come from and give us some explanation on how to build that? Thanks :slight_smile:

@Yna_Db I assume that you are a bit familiar with API Classes.
Room Class has GetBoundarySegments method which require SpatialElementBoundaryOptions as argument and return BoundarySegment. And use GetCurve() method to fetch curves.

And for your question, “where does this code come from?”.
These are from a node of my package that i will release soon.

1 Like

Great, this explanation and the discussion around would be very interesting in a Python category thread. Don’t hesitate also to post information about your upcoming package in the Share category :slight_smile:

1 Like

Since the question of bounding box vs room boundaries was introduced indirectly, you could be interested in this:

See also room boundaries nodes in the Dictionary if needed:
http://dictionary.dynamobim.com/#/Revit/Elements/Room/Query/FinishBoundary

1 Like

@jean thanks for your reply.

Prefered OOB nodes but will try to get my hands dirty!

@i.tzivanidis there is an OOTB node, :grinning:

http://dictionary.dynamobim.com/#/Revit/Elements/Room/Query/FinishBoundary

That was not clear in my previous post?

:grin::grinning:

1 Like