Dear all,
I am using 1 dynamo script in Revit 2020 & Revit 2022.
But ‘Element.ElectricalCircuit’ node from MEPover is not working in Revit 2022.
Could you please help me resolve this issue?
Thank you in advance.
Below Images from your reference. I have encircled the node output in orange color.
Revit 2020 Image:
Revit 2022 Image:
Hi,
try this
import clr
import sys
import System
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
uidoc = uiapp.ActiveUIDocument
skNumber = int(app.VersionNumber)
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Electrical import *
def get_Systems(elem):
if skNumber < 2021:
systems = [e for e in elem.MEPModel.ElectricalSystems] if elem.MEPModel.ElectricalSystems is not None else []
else:
systems = [e for e in elem.MEPModel.GetElectricalSystems()]
return systems
toList = lambda x : x if hasattr(x, '__iter__') else [x]
input_elems = toList(UnwrapElement(IN[0]))
OUT = [get_Systems(elem) for elem in input_elems]
3 Likes
Hello Poupin,
This python script works perfect to solve my purpose.
Thank you for your efforts.
Regards,
Nilesh