Really looking for TPover on this one!
So, I’ve tried modifing TPover’s “Elements in connected network” node from MEPover package to give me the individual connected networks in sub-lists that are connected to a family instance that has multiple connectors. The reason I need to do this is to be able to report primary and secondary conduit lengths for each transformer so that we can order the correct lengths of wire to prefab the transformers with. See examples of scenarios:
Currently, I have a script that essentially uses the Transformer Revit schedule that looks at the XFMR names and finds those elements with that name. From there I can get the the primary and secondary flex from each transformer in a sorted list of sub-lists. From there, I feed each flex element into the modified connected element node that I made to only give me each element or connected network of elements into sublists by transformer. However, I’m getting unexpected/inconsistent results.
The cleanest approach would be to have a python script that would accept the family elements and list all the connected networks in sub-lists from each connector in the family.
I apologize for not having a screen shot of the script. For some reason when I use the Dynamo capture function, you cannot see any text on the nodes. If anyone knows what’s causing this, I’m all ears! Anyway, since I can’t get a good snapshot and new users cannot upload attachments, here are a few screenshots. Just hit me up and I can email you the script if you want to play with it.
Python for modified node:
pyt_path = r’C:\Program Files (x86)\IronPython 2.7\Lib’
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
from Autodesk.Revit.DB import *
#The inputs to this node will be stored as a list in the IN variables.
element = UnwrapElement(IN)
toggle = 0
element = [UnwrapElement(IN)]
toggle = 1
listout = [elem]
connectors = elem.ConnectorManager.Connectors
connectors = elem.MEPModel.ConnectorManager.Connectors
for conn in connectors:
for c in conn.AllRefs:
#elif c.Owner.GetType() == Mechanical.MechanicalSystem:
elif c.Owner.GetType() == Plumbing.PipingSystem:
elif c.Owner.Id in lookup:
newelem = c.Owner
if elem.GetType() == Mechanical.MechanicalSystem or elem.GetType() == Electrical.ElectricalEquipment:
params = elem.Parameters
for param in params:
if param.Definition.Name == “Panel Name”:
cont = 0
elements = nextElements(elem)
for x in elements:
if x.Id in lookup:
cont += 1
item = doc.GetElement(x.Id)
lookup[x.Id] = item
if cont == len(elements):
lookup = collections.OrderedDict()
for x in element:
#Assign your output to the OUT variable.
OUT = lookup.Values
OUT = listout