Elevation of linked Level respect to hosted file

Hello everybody,

I have a project file with many linked files in it (tiny houses). Every linked file has its own level, and I’m trying to get the elevation of that level respect to the ground level of the hosted file. How would you do it in python? Properties like BoundingBox or Location are not working (I get Location but not the point…), and Elevation property gives me the elevation respect to the ground level of the linked file, of course. This is part of my code, if it helps:

for room in rooms:
    roomLevel = room.Level.Elevation
    for linkInstance in linkInstances:
        linkDoc = linkInstance.GetLinkDocument()
            allCeilings = FilteredElementCollector(linkDoc).OfCategory(BuiltInCategory.OST_Ceilings) \
                                                           .WhereElementIsNotElementType() \
            for ceiling in allCeilings:
                ceilingLevelId = ceiling.LevelId
                ceilingLevel = linkDoc.GetElement(ceilingLevelId)

Thanks in advance!

Bimorph nodes package might be starting point. They have a get linked element of category node.

Thanks Simon for your responde. I know how to get linked elements and their properties, but the problem I have now is with levels. Bimorph nodes are not accessible and I can not check the python code.


what method for linking did you use? Shared coordinates or something else?

Hi Marcel,

I used the basic way, just Insert/Link Revit.

in the basic way you have 4 options.
to help you its important to know what choice you made
if you are on the same computer the method you have chosen is probably set as default now.
so go to insert an link a new revit file, check the default and abort

Ah OK, I understand: I used Auto - Origin to Origin

the easiest way is to make a Level schedule
click the tick mark for include Linked Models
and specify in the available fields: name and elevation and if you click on Levels above the fieldnames change it to Revit Links an add the Revit filename from the fields
click OK
now you have most of it i guess, without opening Dynamo :slight_smile:

Thank you very much, Marcel. I like the idea but it’s not working :sweat_smile:, because it says that all the elevations are equal, and it’s not true (every linked file is in different level).


The main problem is that I have 400 link instances, but you made me think to find a solution out of Dynamo and I have it: every link instance has a room in it, so I will take the level from there.

Thanks again for your time! :grinning: