i would like to retrieve all pipes systems trough python script. i did this through nodes. but i would like to learn how it is doing by scrip.
i am new in Dynamo. so please help me.
pipe system type.dyn (8.3 KB)
i would like to retrieve all pipes systems trough python script. i did this through nodes. but i would like to learn how it is doing by scrip.
i am new in Dynamo. so please help me.
pipe system type.dyn (8.3 KB)
Hi @shibujoseukken,
Here is the script :
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.Plumbing import *
pipingSystem = FilteredElementCollector(doc).OfClass(PipingSystemType).ToElements()
OUT = pipingSystem
can you please provide the reference or links for the below codes.
FilteredElementCollector(doc).OfClass(PipingSystemType).ToElements()
To access to the PipingSystemType class, you need to import the Autodesk.Revit.DB Plumbing namespace (from Autodesk.Revit.DB.Plumbing import *)
FilteredElementCollector = Creating a Collector of a particular Category of Elements
doc = current doc (doc = DocumentManager.Instance.CurrentDBDocument)
OfClass : (You can find the Class in the API)
http://www.revitapidocs.com/2018.1/b0fe0b71-3b6c-85f0-8279-e93505e82529.htm
.ToElements() = Get Revit Elements returned.