Copy View Templates between projects and overwrite duplicates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I've created an addon in c# to copy view templates between projects - this lets the user pick from a list the exact View Template to copy rather than copying all templates as Transfer Project Standard does.
So the routine works fine, except, if there is a template in the target project with the same name then it places (1) in the name of the template copied.
I would like the routine to overwrite the template, or prompt the user to overwrite or cancel the copy - I don't mind which.
The copy works by calling:
ElementTransformUtils.CopyElements(current document, IDs of view templates, target document, transformation, CopyPasteOptions);
Reading the documents the CopyPasteOptions parameter controls how the copy handles duplicates, but I'm struggling to get this to work and I can't find any good examples on the internet.
I'd appreciate some pointers on how to set up CopyPasteOptions.
Thanks.