Sure, that’s possible, here is how:
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):
connectors = IN[0]
else:
connectors = [IN[0]]
listout = []
TransactionManager.Instance.EnsureInTransaction(doc)
for conn in connectors:
ckt = conn.ElectricalSystemType
#Revit 2017 and older:
#newckt = doc.Create.NewElectricalSystem(conn,ckt)
#Revit 2018 and newer:
newckt = Electrical.ElectricalSystem.Create(conn,ckt)
listout.append(newckt.ToDSType(False))
TransactionManager.Instance.TransactionTaskDone()
OUT = listout
Find the connectors on the elements that you want to use and use those as input for creating the circuits.