What is an Element on a Point

Hello,

I can find x, y, z coordinate values of the element I selected in Revit model with element.getlocation node.

But I want to see the Revit element where I know the value of x, y, z.

Is it possible ?

Thanks

You could compare the distance from this point to the element geometry for all selected elements, and get the one with the least distance (or ones with 0 distance). However it would be slow. If you want to work with items in a room it’s likely be faster to get the room at the point, then filter all elements to just ones in that room, then test distances on the smaller section. Similar filtering could occur by level, or other ‘known’ parameters as well.

I would suggest using Bimorph Nodes to find the intersecting elements on your points.

If you are able to narrow down the types of elements you are dealing with, you could;

  1. gather location of all elements of type/family or category
  2. get your specified input point (X,Y,Z)
  3. process your points to strings so they can be checked as a match (I think points will not match unless converted as they are compared as instances so can never match)
  4. run an ‘index of’ against your list of element location points
  5. return the family at the ‘index of’ using ‘get item at index’ over the initial element list

If you’re dealing with a lot of elements however, it will likely be a slow-ish approach.

1 Like

Thank you so much @GavC

This method is very successful.

1 Like

Glad it worked :slight_smile:

1 Like