Hello,
I am looking for a way to assign a shared parameter to MEP elements that indicates which space they are located in. I found a YouTube video showing how to assign the space to all elements that have a calculation point.
However, the problem is with ducts and pipes, which do not have a calculation point. I wrote a script where I retrieve the coordinates of the given elements. Since these elements are essentially lines, I calculate the midpoint of the line and compare it to the space coordinates. If the element’s coordinates are within a space, I assign the space name to my custom parameter (KM RE).
I have 16 spaces and 1703 ducts. As output, I only get 1 correct result, or in some cases 16 correct results when I change the lacing of Element.SetParameterByName, but I can’t achieve better results.
How should I adjust the lacing, or how should I write a better script to successfully assign the space name to the parameter for ducts and pipes, indicating the space where each element is located?