I am trying to make a way to change circuitnumbers to desired number instead of the automatic setup that is in Revit by default.
I have been looking in the RevitAPI, and it seems that there is a method for this :
[http://www.revitapidocs.com/2017/225a5ab5-8d2e-5fd8-ad6f-c04eb7a4d40e.htm](http://(PanelScheduleView -> MoveSlotTo))
However the input is row and cell number, which is kind of wierd, since moving a circuit includes moving the whole row of a panel schedule. Maybe I am looking in the wrong place?
- Does anyone know how I can change a circuit number in a panel to have another (chosen) circuit number?
I have tried making a python script for this, and this is how far I have gotten at the moment + error message.
import clr clr.AddReference('ProtoGeometry') from Autodesk.DesignScript.Geometry import * clr.AddReference('RevitAPI') from Autodesk.Revit.DB.Electrical import * #The inputs to this node will be stored as a list in the IN variables. OUT = list() cellsfrom = list() cellsto = list() def tolist(input): returnlist = list() if isinstance(input, list): for item in input: returnlist.append(UnwrapElement(item)) else: returnlist = [UnwrapElement(input)] return returnlist PS = tolist(IN) movefrom = tolist(IN) moveto = tolist(IN) for i in range(0, len(PS)): cellsfrom = PS[i].GetCellsBySlotNumber(movefrom[i]) cellsto = PS[i].GetCellsBySlotNumber(moveto[i]) for x in cellsfrom: PS[i].MoveSlotTo(movefrom[i], x, moveto[i], x) OUT = cellsfrom, cellsto