How to retrive duct systems by python script

i would like to retrieve all the duct systems by python (not by dynamo). I am new in dynamo, anybody can help me

Hi @shibujoseukken,

import clr
clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Mechanical import *

mechanicalsystem = FilteredElementCollector(doc).OfClass(MechanicalSystemType).ToElements()

OUT = mechanicalsystem 

1 Like

thank you. one more doubt.

How we can identify MechanicalSystemType is under ofclass

It’s like in the node Element Types.

Mechanical