CopyElements Method Overload in Python

You are only providing 3 arguments, so it is wrongly assuming that you are trying to use (Document, ICollection, CopyPasteOptions) as your overloads. Try this instead:

n_restId = ElementTransformUtils.CopyElements(o_sht, 
                                              o_restId, 
                                              n_sht, 
                                              None, 
                                              CopyPasteOptions())

If your list of ElementIds isn’t already a .NET List, make sure to do so like this:

from System.Collections.Generic import List
o_restIdList = List[ElementId](o_restId)

As for handling native Revit exceptions, I haven’t tried to do that yet in my workflow, but you may be able to import from the Autodesk.Revit.Exceptions namespace and handle the native exceptions directly.

3 Likes