Impossible to get the element location of some Revit elements?!

I am trying to get the element location of all elements in a revit file, I am surprised some elements do not get any result, also I tried in case there is no result with this clockwork node package, then get element geometry solid and if also does not work get the element boundingbox centroid point and also does not work, so what the hell can happen with these miserty elements?! I found elements of categories Curtain Panels, Furniture, Generic Models, Stairs, etc with this issue and I do not have idea what else to do, any clue please respond.

for example the item at index 6 looks like this, when selecting the family instance by ID I do not see the geometry as looks like hidden or transparent geometry and its category is Curtain Panels and the type Empty Panel, and there is a option to Edit model-in place, then I edit and says it is an Opening Swing category, so how to know what is the geometry and location point of this family instance? any of the nodes I tried does not work

I typically use th Transform Origin to deal with … curtain panel for exemple

1 Like

nothing to transform…If I do not get any location geometry…

I think Daniel means taking the origin of Transform as your LocationPoint.

so what is that in a code or node?

Hi,

I think it might help us to understand a little about why you want the element location?

Clearly not everything in Revit has a location… Your example of a curtain panel is dependent on its host grid rather than a Point or a Line… There isn’t much ‘location’ element could be used for?

We can get the centre point of the panel geometry if you would like?

Or if you want a location you can transform, we can get the location of the curtain wall which it is hosted in?

If you search on the forum you will find similar posts.

Hope that helps :slight_smile:

Mark

3 Likes

sorry the answer provided is not working same for all curtain panels elements unfortunately, in my project there are some exceptions that do not get even bounding box and element geometry, so I found possible to get the curtain walls boundary curves with OOTB node and then I can find the centroid of the polycurve, but I find hard to implement in python script

Do the elements exist? Note that when doing stuff like ‘merging’ curtain panels Revit keeps a panel with zero geometry. These keep the previously assigned types and other non-geometric properties, but anything related to geometry (bounding box, shape, location, etc.) will report as null as they’re cleaned from the DB. One thing you can try and pulling the area of the curtain panel.

Also note that they are hard excluded from the schedules and such, so you can’t ever see them in the user interface…

You should be able to select one with Dynamo, get the host curtain wall, select that wall and create a new 3D view that isolates the the relevant categories and sets the section box nice and tight. From there selecting the curtain panel in the UI by way of element ID in the UI should show you that the droid you’re looking for doesn’t really exist.

yes geometry exists although I edit the family and it is a void extrusion so not visible, family is called Empty Panel looks like the default revit panel, that happened also with a Door family not sure why but imagine how difficult is to understand the weird things and make a script to jump all of them when you do not expect things can happen. the screenshots attached show what it is in Revit and dynamo. curtain panel boudaries polycurve node gets at least the contours of the curtain panel, but I am trying to use that in python and I am not sure if there is any Revit API function to call the panel boundaries

So void geometry is another example of ‘won’t show up’, in that there isn’t anything there to show, so Element.Geometry will return null using the default method. Element.BoundingBox might work, but I haven’t tested it. But as noted before in many locations this node might not be accurate enough for your needs. Further curtain panels don’t have a location as they’re defined by the grids locations… so I think you’re stuck finding grid corners for now.

What have you tried so far on that front?

I get geometry of polyline of panel boundaries with this designscript but I do not achieve to use in ironpython in Dynamo:

t1 = t2;
polyCurve1 = CurtainPanel.Boundaries(t1);
polyCurve11 = polyCurve1;
curve1 = PolyCurve.Curves(polyCurve11);

I imported this trying to use in ironpython:

clr.AddReference('DSCoreNodes')
import DSCore
from DSCore import *

I created this script but there are curtain panels with no result so 100% elements must have a result, do I need to consider the families of curtain panels are wrong or corrupt?:

import clr
clr.AddReference('RevitAPI')
clr.AddReference('RevitServices')
clr.AddReference('ProtoGeometry')

from Autodesk.Revit.DB import *
from Autodesk.DesignScript.Geometry import Point
from RevitServices.Persistence import DocumentManager

# Define the function to retrieve location geometry
def GetLocationGeometry(item, transform=None):
    """
    Retrieves the location geometry of an element.
    Handles points, curves, loops, and bounding box centroids as fallback.
    Applies a transformation if provided.
    """
    try:
        # Points and text notes
        if hasattr(item, "Coord"):
            point = Point.ByCoordinates(item.Coord.X, item.Coord.Y, item.Coord.Z)
            return point.Transform(transform) if transform else point

        # Base points and reference points
        if hasattr(item, "Position"):
            point = Point.ByCoordinates(item.Position.X, item.Position.Y, item.Position.Z)
            return point.Transform(transform) if transform else point

        # Independent tags
        if hasattr(item, "TagHeadPosition") and hasattr(item, "IsMaterialTag"):
            point = Point.ByCoordinates(item.TagHeadPosition.X, item.TagHeadPosition.Y, item.TagHeadPosition.Z)
            return point.Transform(transform) if transform else point

        # Views
        if hasattr(item, "ViewType") and hasattr(item, "Origin"):
            if item.Origin:
                point = Point.ByCoordinates(item.Origin.X, item.Origin.Y, item.Origin.Z)
                return point.Transform(transform) if transform else point

        # General elements with location
        if hasattr(item, "Location"):
            loc = item.Location
            if loc:
                # Line-based elements (e.g., walls)
                if isinstance(loc, LocationCurve):
                    curve = loc.Curve
                    midpoint = curve.Evaluate(0.5, True)
                    point = Point.ByCoordinates(midpoint.X, midpoint.Y, midpoint.Z)
                    return point.Transform(transform) if transform else point
                # Point-based elements (e.g., most loadable families)
                elif isinstance(loc, LocationPoint):
                    point = Point.ByCoordinates(loc.Point.X, loc.Point.Y, loc.Point.Z)
                    return point.Transform(transform) if transform else point

        # Fallback to bounding box centroid
        bbox = item.get_BoundingBox(None)
        if bbox:
            centroid_x = (bbox.Min.X + bbox.Max.X) / 2
            centroid_y = (bbox.Min.Y + bbox.Max.Y) / 2
            centroid_z = (bbox.Min.Z + bbox.Max.Z) / 2
            point = Point.ByCoordinates(centroid_x, centroid_y, centroid_z)
            return point.Transform(transform) if transform else point

    except Exception as ex:
        # Return an error message as a string for debugging
        return "Error processing element: " + str(item.Id) if hasattr(item, 'Id') else "Unknown element"

    # If no geometry found, return None
    return None

# Main Script
doc = DocumentManager.Instance.CurrentDBDocument

# Input: Flattened list of Revit elements
elements = UnwrapElement(IN[0])

# Process elements and retrieve geometries
location_geometries = []
debug_messages = []

for e in elements:
    loc_geo = GetLocationGeometry(e)
    if loc_geo:
        location_geometries.append(loc_geo)
        debug_messages.append("Successfully processed element: " + str(e.Id))
    else:
        location_geometries.append(None)
        debug_messages.append("Failed to process element: " + str(e.Id) if hasattr(e, 'Id') else "Unknown element")

# Output location geometries and debug messages
OUT = location_geometries, debug_messages

No, but you need to consider curtain panels which have no geometry - basically if you remove a single grid segment the code will throw an error (the design script) or return a null (the Python) as you’ve written it. Handling that edge case should resolve things.

I cannot edit revit file, only read. I also have a family that it is a door inserted in a curtain wall as a curtain panel, i do not see it but has geometry defined inside of the family, it is a curtain panel family template but category Door, it has room calculation point activated though

No editing involved in what I posted. If the author of the Revit file has excluded a grid segment you will get results like you are mentioning. This means you need to account for it.

1 Like

okay, it does not matter how is modelled, there is an element and I just need a geometry reference from it, so there are some exceptions that I do not understand what else to do with them i tried everything I know, even the panel boundaries do not work for some of these elements that do not get element location, bounding box, I was thinking if I can get a reference plane or something like that and find a geometry reference planes or a point from it

That’s the problem - curtain panels are (as far as I know) the only element which can exist without any means of getting a geometric reference.

Take this image of model and Dynamo graph:

The Dynamo graph gets ALL curtain panels, and sets their mark in order of creation from 1 to 16. But the Revit schedule shows ALL the curtain panels, and the model view shows ALL the curtain panels, and the properties pallet shows curtain panel with mark number 7 but that doesn’t exist in the schedule…

The panels exist in the Revit file, but they don’t exist in the UI in any view - I don’t think you even get them in any exports as Revit filters them out except for internal uses and maintaining the structure of the curtain wall.

I cannot believe some curtain panels do not get any geometrical reference either, what trick is this I am thinking. these families are loadable families so all of them have their own coordinate system so at least want to know the origin of their coordinate system like a point geometry as no geometry is retrieved from the functions available.

Hey,

Could you drop this one panel in a blank Revit file for us to have a look at?

Thanks,

Mark

Any manor of curtain panel built from the curtain panel family template will have this issue - it is built into Revit to be this way and you cannot modify thing to not have that other than not removing curtain grid segments.

Try pulling the area of the curtain panel (or width, or height) and filter by bool mask with a bool pulled from when the area isn’t greater than 0. Those in the ‘in’ output are good as they exist. Those in the ‘out’ are imaginary, just kept by Revit as existing to keep things maintained standard in the curtain wall tool.