How to get total length of selected ducts

Hi everybody,

Can anybody help me to code a dynamo that calculate total length of selected ducts?

Thank you.

Hi, usually people post a screenshot of what they did so far to show their effort. What you want to achieve is quite easy, so I post it anyway:

For the next time take a look at the forum guidelines before posting :wink:


Hi lucamanzoni,
Thank for your help.

Hi lucamanzoni,

I checked your dynamo. I found that it does not quite suitable with my case. With your dynamo, I can only select 1 time. While, what I expect is I can select many ducts in many times, and when I think it is enough, i choose calculate.
Thank you.

If you want to select and then calculate, you can select all that you want and then temp isolate (shortcut HI), and then use @lucamanzoni’s script. Please note that he is using Select Model Elements, key part being elements plural. Without the S, you can only select one at a time.

Alternatively, I believe it is rhythm? that has a node you can use that takes whatever is currently selected as the input.

Thank kennyb6 for your idea.

Yes exactly, the topic was about calculating the total length, so I showed it in the fastest way, not focusing on the selection part.
There are many way to select objects, another common way is to pick the Category, then AllElementsOfCategory and then filtering the selection according to what you need. Take a look at the forum or at the DynamoPrimer to find more information about selecting and filtering.