I’m looking to find the Geometric Center Location of Listed elements, so that I can group them together.
Specifically I have am interested in finding the center of various MEP Pipe elements, and would like to be able to select only the elements in which their center is within a particular view/scopebox.
I have a script now that collects elements from a selected view and then sets a parameter value accordingly. Minor issue is that most of the time the pipe is present in two views. So when I run the script for [Scope Box A] it designates [A] in the parameter, however when I continue onto [Scope Box B] which is right next door, it grabs some of the same elements and overrides those values with [B].
Is there a way to select elements, only if their Centers’ are within a View/Scopebox?
This would require you getting the element geometry, combining it, then getting the centroid of the combined solid. You’ll probably run into issues combining some of the solids and it’s rather data intensive. You would probably be better off getting the locations of your elements. Any elements with a curve-based location could use the midpoint of the curve.
This should work for most elements:
bounding box from element.
Average of bounding box min point and bounding box max point for the center.
Then find out if your point is within the desired scope box/space/whatnot.
@Nick_Boyts@jacob.small Thank you for your responses. So I’m trying to convert the elements into solids (individually) and I think I might be setting it up wrong in some way. Is the “Element.Solids” node the incorrect node to be using?