Getting all connected elements of a single conduit run by splitting a list of all conduit runs

I am having an issue with the the beginning of a problem I am trying to solve. I will describe the overall goal of what I am trying to achieve, and then go into explaining the problem illustrated in the screenshot below.

The problem that needs solving is that I am trying to get each conduit run in a project (easy enough), then get the list of every segment of conduit and conduit fitting that make up the conduit run. I am then taking those segments and conduit fittings and filling out a custom “To” and “From” parameter on them. The reason this needs to be done this way is because Revit itself does not propagate custom parameters to conduit fittings (probably because it doesn’t know how many fittings (bends) there are on a run, so it doesn’t want to collect them and give them a “To” and “From” param, even though they are shared params that should be propagated through all parts in a conduit run)

Now onto the problem:

In the screenshot below, I am pulling a list of all conduit runs. what I need this list to do is feed each individual conduit run in the list to the elements in connected network node (ECTN for short). the ECTN node only has one input of a single element, this means I have to feed the elements in one at a time to receive a list of conduit segments and fittings in the network.

What I need to know is:

A. How do I separate each conduit run in the list in order to feed them one at a time to the ECTN node. If I can accomplish this then I can change the “To” and “from” params of each part in the run myself.

B. What format does the ECTN node take as an input so that I know how to shape the data coming to it, because right now a single conduit run reads as NULL.

The ECTN node does not work with conduit runs actually. It is designed to work with actual elements, so in this case that would be the conduits or conduit Fittings.
I did a little searching and turns out that the Revit API does not provide a way to collect every conduit and fitting of a conduit run. The only thing I found is the ability to get the conduit run of a conduit. So a workaround would be to:

  • get the conduit run of every conduit
  • get the first conduit of every run
  • supply those to the ECTN node

Conduit and fitting for every conduit run.dyn (5.7 KB)

Thank you for your time T_Pover.

I have thought about the problem a little more and consulted some of my working mates (the ones I am developing this fix for in order to increase their workflow).

The issue they raised was something along the lines of “Our “To” and “From” params are often incomplete throughout the conduit run so what we really need is for you to take the TO and FROM from the junction box at the end of a run and propogate that information to the entire run.”

That is to say that the junction box at the end of the conduit run are the only thing in the network that are guaranteed to contain the TO and FROM params. So I have shifted my focus to trying to copy the junction box params to the params of the whole conduit run by virtue of them being in the same network of elements.

This gets me closer to the solution I am looking for, however, I do not know how to reliably accomplish it. Below is a screen shot of where I am currently in my solution. There is two problems that I have encountered so far with it:

  1. the currentSelection node is not updating properly with the script set to automatically execute. I would expect it to execute every time something is selected in revit, but it does not.

  2. It appears that everything is working right in the script except the GetParameterValueByName node does not appear to recognize the junction box (the currently selected object in the pic)

If you have any more insight to give, I would be greatly appreciative. Thank you for what you have done already.

EDIT: accidentally uploaded wrong photo

Ok, one more update.

The pic I linked above actually does work, it is just the currentSelection node that is messed up. I have to restart the script (as in reload the file) every time I want it to update the selection and retrieve the updated param. I have no idea what is causing this but if you know where I could find functionally identical node to the currentSelection node then I could use that as a replacement. The node is in the Springs package.

Select model element node should do the trick. or run the graph via Dynamo Player.

1 Like