Select items by width?

Hi all,

I am attempting to select items based on their width and then extract their locations to get the linear footage of these items. I am using conduit for my test run but will want the script to also do plumbing pipe and ducts.

So I need to be able to separate 1", 2", & 3" conduit and get the respective linear footage’s of each type. Anyone have an idea on this?

It seems like it should be simple to me but I am pretty new and having trouble with this script.

Right now I can get a list of each type of conduit in the model but I need to be able to select just the elements for each diameter of conduit.

Any help is appreciated, thank you!

Now that you have your individual sizes you need to filter through your list of pipes and get the corresponding elements for each.

1 Like

Hi @mcooper4GXRR,

I can suggest another approach, using the “List.GroupByKey” node.

With this one, you can group every item with the same width in sub-lists.

Here is an example with windows

Let me know if this would do the job :slight_smile:

Cheers

1 Like

@lkichenin

This looks promising but what package is the Element.ElementType node from? I cannot find it?

@Nick_Boyts

I tried this but at the end I need to be able to select each conduit in the list. The next step of my script is to break each list out, and convert the conduits into lines. Then I will intersect them with a cube. From here I will get each length that intersected with the cube, add them together and then I will have the total linear footage of each conduit type that intersects with that cube. I have many cubes and am trying to figure out the amount of conduit that runs through each one.

@mcooper4GXRR

In my dynamo version (1.3.0), Element.ElementType is already included in the standard packages.

Otherwise, you can use Element.Type from Clockwork package for this kind of task.

This is the package I used to use before.

That’s what the script does, I just showed you the diameters at the end to prove that they’d been successfully sorted.


@lkichenin shows another way of sorting the elements first, but you still have to break them out into groups. After that, you’ll be able to intersect your cube geometry and get the total lengths of each size (with a lot of list management).

1 Like

@Nick_Boyts

Thank you so much, I apologize because you were exactly right. The script runs perfectly(I’m a bit new to Dynamo in case you couldn’t tell).

@ikkmerimaa

Thank you for the help, I ended up downloading the Clockwork package.

Thank you both for the quick replies and options, they were both very helpful.

Yeah, exactly the same at the end :slight_smile: