Bounding box in Dynamo & Revit API vs Revit View it's not the same

Bounding box in Dynamo & Revit API vs Revit View it's not the same

rade_tomovic
Advocate Advocate
3,337 Views
5 Replies
Message 1 of 6

Bounding box in Dynamo & Revit API vs Revit View it's not the same

rade_tomovic
Advocate
Advocate

So here is my problem, I'm developing add-in for Autodesk Navisworks to get all elements on floors based on their geometry. To do that, I'm using:

 

element.get_Geometry(new Options).GetBoundingBox()

 

For some reason, I got elements from top/bottom floors, seemingly incorrectly. But when I tried to see what is happening in Dynamo, I got this:Screenshot 2021-06-21 200636.pngScreenshot 2021-06-21 200721.png

 

So first image shows level in Revit with curtain wall, second image shows level (brown) in Dynamo with bounding box of an element (purple). Numbers on the Dynamo image are the same I got through Revit API. 

 

Any thoughts?

0 Likes
Accepted solutions (1)
3,338 Views
5 Replies
Replies (5)
Message 2 of 6

architect.bim
Collaborator
Collaborator

Hi!

The reason is rather simple: these are different kinds of objects. 😀 BB in Dynamo is not the same as in Revit API. Dimensions of BB got in Dynamo may differ from dimensions of BB got with Revit API (the size of the latter may be affected by a number of hidden geometry elements).

So you have to choose wich objects you want to work with. And choose only one of them for the consistancy.

P.S. If I were you I would use Dynamo BB as they provide more predictable results (in my opinion).


Maxim Stepannikov | Architect, BIM Manager, Instructor
0 Likes
Message 3 of 6

rade_tomovic
Advocate
Advocate
Yep, but the problem is that both Dynamo and Revit API are having the same values for BB Z coordinate, but somehow when you compare that to any view, it looks like level is somehow not aligned (check attached images). Is there a possibility the fact that project base point and triangle point (forgot what is the exact name) are not aligned somehow affects position readout?
0 Likes
Message 4 of 6

RPTHOMAS108
Mentor
Mentor

If level is wrong could be related to Level.Elevation vs Level.ProjectElevation

 

Level.Elevation:

Retrieves or changes the elevation above or below the ground level.

Level.ProjectElevation:

Retrieves the elevation relative to project origin, no matter what values of the Elevation Base parameter is set.
 
BoundingBox doesn't consider elevation base parameter.
 
Should also note that last time I checked the built-in dynamo nodes for co-ords seem to report old information (ignoring changes in base point objects), however a python node doing similar worked ok.
 
0 Likes
Message 5 of 6

rade_tomovic
Advocate
Advocate

So you're saying that BoundingBox Z-coordinates are not comparable to Level.Elevation but rather to Level.ProjectElevation?

0 Likes
Message 6 of 6

RPTHOMAS108
Mentor
Mentor
Accepted solution

Yes there is a slight conflict in terminology because general Revit users think of the project coordinate system but with API ProjectElevation means internal i.e. the internal origin of the project file.

 

Level.Elevation is going to depend on three things:

The internal level

The project base point level

What has been set for Elevation Base in the associated level type

 

Basically Level.Elevation indicates the elevation you see when you place the level in a view.

The below image highlights the differences and also includes permutations of similar settings in Spot Elevations.

 

I moved the clipped survey point down 10ft and project base point down 5ft. The internal origin is shown at Level 0 / Level 1. The values you get in Revit Lookup are shown adjacent to each level.

 

210622_Levels.png

 

In summary best to use ProjectElevation for most API activities with levels (this is unambiguous compared to internal).

0 Likes