Copy Elements form a Document to Current Document

I am trying to copy elements from a document (not linked document) and copy some elements (drafting views) to current document. I am having issues with getting collection of ElementIds. Could someone please help me with it?

curr_doc = DocumentManager.Instance.CurrentDBDocument
doc = UnwrapElement(IN[0])
elements = UnwrapElement(tolist(IN[1]) )
p=[]
for i in elements:
	p.append(i.ToElementIds())




TransactionManager.Instance.EnsureInTransaction(doc)
copy = ElementTransformUtils.CopyElements(doc, elements, curr_doc,  Transform.Identity, None)
TransactionManager.Instance.TransactionTaskDone()
OUT = [curr_doc.GetElement(i).ToDSType(False) for i in copy]

Hopefully this clarifies things. The example contains an ICollection for ElementIds.
ICollections - Developers - Dynamo (dynamobim.com)

1 Like