Get Insulation on Pipe

This is a bit tricky as there is no out of the box way to get the pipe insulations for a pipe, you need access to the Revit API.
You can use the code below to access the insulation of a pipe:

import clr

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument

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

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

if isinstance(IN[0], list):
	pipes = UnwrapElement(IN[0])
else:
	pipes = [UnwrapElement(IN[0])]

listout = []

for pipe in pipes:
	try:
		insulation = InsulationLiningBase.GetInsulationIds(doc,pipe.Id)
		listout.append(doc.GetElement(insulation[0]))
	except:
		listout.append(None)


OUT = listout

I’ve also added the node to my package MEPover

4 Likes