Duplicating Legends Glitch?

I’ve trying to get around the fact that Dynamo cannot create a new legend by duplicating an existing template legend, but when I attempt to duplicate (with OOTB or Orchid nodes as seen below) I appear to hit some kind of glitch where the name messes up?

I then cannot take my workflow any further as the view isn’t created.

Looks like the view is created, but in the other document.

Not sure how I managed that! I’ve only got the one document open.
I’ll do some investigating, thanks

Oh - I might be wrong on this. Most use of the Orchid package typically involves background opening documents (the source of the template I thought you were mentioning).

I think the issue extends further than this.
I tried switching to all OOTB nodes to hopefully avoid any custom node tomfoolery, but I was getting inconsistent results. The first time I’d run the script, it would function as intended, creating a new legend with the given name.

If I then deleted that legend to trial the script again, it would not create a duplicate view, instead throwing the Name = blank error shown previously.

It’s almost like Revit is retaining deleted legends, similar to how rooms aren’t deleted in the first attempt.

Sounds like an element binding issue for sure; try running only via Dynamo Player, or generating the name dynamically (ie: appending a new GUID in all cases) to see if that cleans it up.