Select Model Element "ConduitRun"

I’m trying to Selectively propagate shared parameters values from conduit to a conduit run. My script will propagate the parameters to connected conduits and fittings using the “Select Model Element” just fine. However, I can’t find a way to “SetParameterValuesByName” for a single ConduitRun. “Element Types” will get All the “ConnduitRun”(s) How can I get just a single ConduitRun so my parameters won’t populate all runs?

image

In this graph I am getting all the connected conduits with some nodes from the MEPover package. You could start with this method and modify it.
Select model element, get parameters from it, get connected, apply the parameters to the connected elements

Thank you so much for replying.

I actually have MEPover package loaded and I’m using the node “Elements in Connected Network”. However, The node uses conduit and fittings elements and is not the “ConduitRun”

On another post I found a Python Script Node that I renamed to Gets Conduit Run ID.

import clr

clr.AddReference(“RevitServices”)
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument

clr.AddReference(“RevitAPI”)
import Autodesk
from Autodesk.Revit.DB import *

clr.AddReference(“RevitNodes”)
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

if isinstance(IN[0], list):
elements = UnwrapElement(IN[0])
else:
elements = [UnwrapElement(IN[0])]

OUT = [doc.GetElement(x.RunId) for x in elements]

This allows me to select 1 conduit which then selects the connected network but also identifies the counduit run.

@jacobmock3577
Hello this would be great I am trying to find a way to coorelate conduit run to its elements. But it is not working for me, what version of dynamo/revit are you using? What is inside your other python node? could you show us please?


Whats in the python script is shown above.
You can copy the below into a Python Script.

import clr

clr.AddReference(“RevitServices”)
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument

clr.AddReference(“RevitAPI”)
import Autodesk
from Autodesk.Revit.DB import *

clr.AddReference(“RevitNodes”)
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

if isinstance(IN[0], list):
elements = UnwrapElement(IN[0])
else:
elements = [UnwrapElement(IN[0])]

OUT = [doc.GetElement(x.RunId) for x in elements]

I am also not sure why but typing in the Python script is what you need to do per your image it is not working correctly. Colors of the text should look like this. Looks like it should be the yellow text only you need to fix.
image

1 Like

I am also running this Dynamo and working in Revit 2019.2
image

1 Like

The left python script is just selecting the element in Revit. Same as this guy.
image

Here is my selection script I got from someone.

import clr

clr.AddReference(“RevitNodes”)
import Revit
clr.ImportExtensions(Revit.Elements)

clr.AddReference(“RevitServices”)
import RevitServices
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument
uidoc = DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

def output1(l1):
if len(l1) == 1: return l1[0]
else: return l1

selid = uidoc.Selection.GetElementIds()
OUT = output1([doc.GetElement(id).ToDSType(True) for id in selid])

image

1 Like