How to Get width and Length of Floors

Hi Guys,

I’m trying to get the rough width and length of a floor. I managed to get to the correct values as long as the floor is not a very awkward shape.

As long as the floor doesn’t sit at an awkward angle to the X and Y axes I was able to display a length and width value which are very close what I am able to measure in my model.

As espected if the floor sits at an angle to those axis the measurements aren’t even close.

More useful would be to get the span direction as a curve which would help to get the length and the width by somehow creating a line rotated by 90 degrees from the span direction but I’m not sure if I’m not in the right track.

Hi @erfajo
I think the problem with the bounding box is that it would be axis aligned?

Hi @claudiubrb
I guess part of the question for you, is just how you define what you are dimensioning?

Here’s a method which gives you some distances between opposing faces… Perhaps it helps?!
Thanks to @jacob.small for the inspiration.


1 Like

Hi Guys, now that I went through some posts I think ideally the dimensions would coincide with a bounding box aligned not to the axis but to the span direction. I’ve already tried to get the span direction using a python script which unfortunately didn’t work.

Like this?

http://www.revitapidocs.com/2018/d029779d-cc65-5ed5-5ff1-a7abab977dc6.htm

Hi Mark,

I do believe you are working with Dynamo 2.0 and Revit 2018 so I am getting an error in my Dynamo 1.3.3 with Revit 2017.

Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
expected an indented block

Hey, no, that’s an error of just Python typing (which obvs isn’t there in mine) you need to have 4 spaces or a tab for the indents…

You can check that the property is still available in 2017 by hitting this at the top…image

I must be doing something wrong because now is worse and I cannot see the differences

Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “”, line 12, in
File “”, line 8, in isInstance
NameError: global name ‘isisntante’ is not defined

image

You have to be very careful with your typing… the Python error is helpful, it’s telling you that you have a typo in line 8… and you do… :slight_smile:

thanks, got it.

Hmm… see if this helps?

I’m trying to use the fact that when Dynamo patches a surface it doesn’t do it properly…
image

Floor Dist.dyn (37.1 KB)

I think I’ve done it. After I select one floor element the program checks if the span direction is 0. If it is it goes and creates a bounding box around it and displays the width length and height of the rectangle containing the floor.
If it reads the span direction as being anything other than 0 it rotates it back and does the rest of the process.
Now if I may, the full goal of the exercise is to do this for all the floors. Something which the script to get the angle cannot handle yet.

OK I got to the full results that I wanted. I wrapped the python script into a custom node and changed the lacing to Longest and it accepts lists.
So now the output is that a list one list of Floor lengths, Widtsh and Heights exactly as I wanted it in the first place.

3 Likes

Springs package has a node called Springs.Points.MinAreaRectangle.
Input your floor’s vertices and retrieve the smallest rectangle to contain your geometry without the temporary rotation of geometry.
This workflow would probably cost you 5 nodes to get you what you want.

2 Likes

Hi Andre, indeed the springs node does the job quite well. Thank you

1 Like

Hi,
I am trying to recreate what you have done but question ‘GetSpanDirection’ is node from a package ? or is the python script that you post before.
Thanks

@claudiubrb and the rest of the contributors, thanks for the script, I am busy to build a script to add Parameters (Instance/Type) to Shared Parameters from the Client. This have help me to get the L x W x T of the floors.