It also seems that the script does not run well if already powered elements are part of the selection.
I think that could be implemented in the script with a boolean input; Disconnect powered elements and connect the input elements all together, or to skip already powered elements and connect the remaining elements to a new circuit.
By the way I have published a few nodes in a package called “RIE”. Nodes for creating circuits, selecting panel, and drawing wires for circuit ++.
The code for the nodes is implemented for revit 2018, so some of them might not work on older versions.
Do you know of any good packages for electrical installations?
I have MEPover, which has been kind of useful, but I still haven’t found any great packages for creating stuff for electrical installations.