import clr

clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

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

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

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

ids = []

for j in views:
	ids.append(DisplacementElement.GetDisplacedElementIds(j))
	
allelems = []
for x in ids:
	elem = []
	for y in x:
		elem.append(doc.GetElement(y))
	allelems.append(elem)	
	
OUT = allelems