Hi, I wish to copy objects from a linked file. The new object uses an updated family. My wish is that Revit asks me if I want to replace it, but currently, I don´t get it to work. Revit copies the object and creates a new family with a number extension in the name. The code I use is the following:
class CustomCopyHandler(IDuplicateTypeNamesHandler):
def OnDuplicateTypeNamesFound(self, args):
return DuplicateTypeAction.UseDestinationTypes
#return DuplicateTypeAction.Abort
options = CopyPasteOptions()
options.SetDuplicateTypeNamesHandler(CustomCopyHandler())
TransactionManager.Instance.EnsureInTransaction(doc)
copy = ElementTransformUtils.CopyElements(linkDoc, eId, doc, tf1, options)
TransactionManager.Instance.TransactionTaskDone()
I need Revit to show this popup:
Am I doing something completely wrong?