Electrical circuit path

Hello everyone,
I have a number of electrical circuits in my current project (more than 80). The circuit path for all of them is set by default to “Farthest device”. I would like to change all of them with dynamo to “All devices”, but i have not seen any way of doing it.
Does anybody have an idea?
Thanks,
Daniel

Hi @s258085 ,

Is the “Path Mode:” setting a parameter? Because if it is you can use, for example, the node Element.SetParameterValue.

Regards,
Daan

1 Like

Unfortunately no, “Path mode” is not a parameter.

@s258085 This script will do the trick: Electrical Circuit Path Mode.dyn (8.2 KB)

#Code courtesy of http://dynamobim.ru/forums/topic/%D1%81%D0%B8%D0%BD%D1%82%D0%B0%D0%BA%D1%81%D0%B8%D1%81-revit-api-%D1%80%D0%B5%D0%B6%D0%B8%D0%BC-%D1%82%D1%80%D0%B0%D0%B5%D0%BA%D1%82%D0%BE%D1%80%D0%B8%D0%B8-%D1%8D%D0%BB%D0%B5%D0%BA%D1%82%D1%80%D0%B8/

import clr
clr.AddReference('RevitAPI',"RevitServices")
from Autodesk.Revit.DB.Electrical import ElectricalCircuitPathMode as ecpm
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
 
circuits = UnwrapElement(IN[0])
circuitMode = IN[1]
out = []
 
for circuit in circuits:
    TransactionManager.Instance.EnsureInTransaction(doc)
    if circuitMode:
    	circuit.CircuitPathMode = ecpm.AllDevices
    else:
    	circuit.CircuitPathMode = ecpm.FarthestDevice
    TransactionManager.Instance.TransactionTaskDone()
    out.append(circuit.CircuitPathMode)
    
OUT = out
3 Likes

Thanks a lot, it works great!

2 Likes