Get Level 3D extents

Hello forum

Does anyone know if I can get a level 3D extents plane into Dynamo to then have as dynamo geometry/outline?

Any suggestions would be greatly appreciated. Many thanks for any ideas.

Tim

What have you tried so far? I’d start with getting the level element and then checking its geometry or bounding box for the extents.

Hi Nick

Many thanks for your reply. Yes I tested both of these, please see attached. An empty list with the geometry node, and the bounding box needing an instance?

Thanks again for any ideas. I vaguely remember around version 2021 of Revit allowing the 3D views to show the 3D extents of the level. Maybe there is still a restriction with the API?

Thanks again

Tim

There is a Genius Loci node for getting the plane at a level which might help you:
image

Hi Jake

Thanks for your suggestion. Yes I tried the same Clockwork node for this before, and you do get an infinite abstract plane, but not a bounded 3D plane you can see in the 3D view. See below.

Thanks again for your idea.
Cheers
Tim

It seems that levels have a method called GetCurvesInView.

view = UnwrapElement(IN[0])
level = UnwrapElement(IN[1])

curve = level.GetCurvesInView(DatumExtentType.ViewSpecific, view)

OUT = curve 

But I’m having issues trying to avoid the exception “The datum plane cannot be visible in the view.” and all the examples of the forum of using this method involve grids.

Has anyone else successfully used this for levels?

Good point, if you’re using a version older than 2020 you might not be able to get the geometry that way. The guaranteed way should be as @haganjake2 has shown, using the Revit API, however that specific method may requiring some more research.

Hi Nick, Hi Jake

Thank you for this. I am using the latest version of Revit, 2022. I am not up to using python, but I know someone who does, so I will ask him to take a look.

Thank you for your thoughts so far.
Tim

To get the Level extents you could use the .get_boundingbox from the DatumPlane object, and the view you use in the input parameter needs to be a 3D view in perspective as shown in sample C# and Python code below. The sample code gets you started and will get the MIN point of the extents. Modify to get MAX point then you have the extents.

Hi Marcello

Thank you very much for this! This is great help.

I will give this a test.
Thanks again
Tim

I updated the post in case Python is more your flavor than C#

Fantastic, yes I can copy and paste Python ok :slight_smile:

Thank you again.
Tim

There is a node Levels.Curve in DynaMEP Try That

Hello. Amazing thanks. Will take a look! Thanks again. Tim