Is it possible to match the level of an element by its offset?
I have a workflow that adds a sphere around clashes. Now instead of searching each element ID to find the clashes I would like to show what level each clash sphere is on.
Hi,
If I have well understand your question, I would suggest you to extract the Location (Element.GetLocation) of the family Clash Sphere, then subtract the Z of the position with the “Offset from Host”. The result should be exactly the Elevation of the hosting level so you can easily create the comparison between sphere and levels.
I would suggest you to GroupByKey all the sphere, using the found value as key, and then make the equivalence to discover who is match with who.
extract a relevant Z value of each sphere, list all the elevations of your levels, and subtract the one from the other. The set of values that returns the smallest difference is the one corresponding to the closest level to that sphere.
Thank you! I am getting a error on the List.sortbykey… I tried to list.sort on the level elevations before the “-” node as well.The error says:
“Warning: Internal error, please report: Dereferencing a non-pointer.
Internal error, please report: Dereferencing a non-pointer.
List.SortByKey operation failed.
Number of items does not match the number of keys.”
your list structure for the lower flow is one deeper than in my example - either change the list@level for the sortByKey, or try flattening the list after your point.z node
No, extracting the absolute value of the height difference is of course correct - I forgot about it in my draft. It is also, by the way, what the Spring node does. So it´s still what you are doing, you are just not seeing it