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…?
Yna_Db
November 1, 2017, 9:27pm
3
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?
Yna_Db
November 1, 2017, 9:58pm
5
I was just thinking that there could be an offset due to the slab thickness that could create a void between elements
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?
Yna_Db
November 1, 2017, 10:26pm
8
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
jean
November 7, 2017, 3:29am
9
@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
Yna_Db
November 7, 2017, 8:30am
10
Could you tell us where does this code come from and give us some explanation on how to build that? Thanks
jean
November 7, 2017, 9:04am
11
@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
Yna_Db
November 7, 2017, 9:11am
12
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
1 Like
Yna_Db
November 7, 2017, 9:40am
13
Since the question of bounding box vs room boundaries was introduced indirectly, you could be interested in this:
@Rune_Haugland You are correct in your assumption, Tool.SurroundingElements uses the “BoundingBoxIntersectsFilter ” witch filters out objects that are contained or intersects with the BB. The problem with bounding boxes is that they must be rotated along the global x and y axis. The image below shows two identical beams and columns, but the filter works differently on them because of the rotation:
[image]
Have you tried the Geometry.DistanceTo node? Here is an example:
[image]
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!
jean
November 8, 2017, 9:45pm
15
Yna_Db
November 9, 2017, 7:58am
16
jean:
there is an OOTB node
That was not clear in my previous post?