Relative coordinates of hosted families based on the element's start point

I have several elements in Revit, and I need to categorize them based on the placement of the hosted families in each element. I am trying to create a coordinate system at zero parameters of each element’s location curve and find the relative coordinates of the element’s location curve start point, and the hosted families in the same element by using the created local coordinate system so I will always get the same vector when I connect the start point of the location curve line to the location of the hosted families, but for some reason I do not understand, I do not get the same vectors, even though my elements are identical.
Could you please help me to understand where I am doing it wrong?



Test.dyn (30.5 KB)
Revit File

I do appreciate your help in advance.

Regards,
Farshid

Hi @farshidkaviani ,

To determine the position of each child-element, in this case the windows and doors, relative to the host-element, in this case the walls, you need to create a local coordinate system for each wall in a logical position, i.e. the insertion point (or startpoint of the curve) of the wall.

When you then have those coordinate systems you need to transform the insertion points of the windows, doors, etc. to match the newly created coordinate systems. If you’ve done that you should be able to compare the locations of those child-elements.

I’ve tried to work something out for you below:


2023-10-13 Use Host-Element as reference point to compare Child-Elements.dyn (19.1 KB)

PS: Perhaps insertion points are not that reliable, perhaps the centroid or something might work better.

2 Likes