Create Displacement Element

Firstly, thanks for the reply. This community is awesome.
Secondly, I’ve tried to understand about iCollections and XYZ classes…
After some errors, now I got stuck in this one.

Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “”, line 38, in
Exception: #elementIds# contains no element ids.
Parameter name: elementsToDisplace

import clr

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

clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI import *

clr.AddReference('System')
from System.Collections.Generic import *

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

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

#Preparing input from dynamo to revit
elementIDS = UnwrapElement(IN[0])
vetor = UnwrapElement(IN[1])
vista = UnwrapElement(IN[2])


#Do some action in a Transaction

TransactionManager.Instance.EnsureInTransaction(doc)

icollection = List[ElementId](elementIDS)

dispElem = DisplacementElement.Create(doc, icollection, XYZ(vetor.X,vetor.Y,vetor.Z), vista, None);


TransactionManager.Instance.TransactionTaskDone()

OUT = dispElem