What node do I use to select all elements? since “all elements in active view” selects only visibles elements. Elements like stairs aren’t selected and i need them to be selected aswell.
What exactly are you trying to do? “Select all elements” is somewhat vague. What kind of elements? All elements is probably not what you’re actually after. All placed elements? All model elements? All elements of specific categories?
I want to calculate the volume of each material (concrete, steel, etc) in the building.
So you’d first want to determine what kinds of elements (likely by category) you’ll have. You can then use Dynamo’s All Elements of Category
or a FilteredElementCollector
via the API to select elements by category (or class, custom filter, etc. with the FEC).
The bigger problem is that it’s unlikely your model is setup to pull correct material volumes. Does each element have a material and volume already assigned or are you trying to calculate the volume as well? Are you considering multiple materials for a single element or will each element only represent one material? How much of that element is being calculated for the material volume? If you just want a rough rough estimate you can go about it this way, but this usually isn’t helpful for accurate takeoffs.
So, I want it to be able to run on any model, so I don’t know what kind of elements will be involved.
I use the element.material+ node for pulling material volumes, the node uses the material name and volume from revit and give you total volume of material. It not 100% accurate but it’s the best I found.
I have attached my file for extra reference
summaterials.dyn (68.3 KB)
You still have to determine what kinds of elements could exist. There is no method for getting all arbitrary elements modeled so you have to determine what kind of logic will work best for you. If you don’t even want a chance of missing some then you could use a custom node or API method to get all model element categories and then all elements of those categories.
I’ve previously achieved this by using a filtered element collector with the only filter being that it’s visible in a newly created 3D view, and where the element is not an element type.