Select sheet using Data Shape and Duplicate Using Bimorph Node

Hi I am trying to duplicate sheet after selecting it from Data shape & bimorph Node,
sometime its working in some files but in some files is showing some errors. will you please help.
Warning says sheet duplication is failed the managed object is not valid. Can any one help on this?

@sps.25788 Try Adding a flatten node. the Sheet input port is expecting just a list (Sheet)

image

cant understand what will be the input to list.flatten, will you send entire programme image.

@sps.25788

No improvement, Its act like strange. Some files its fine some give errors. it says “The referenced object is not valid, possibly because it has been deleted from the database or its creation was undone.”

Flattening by an amount of 0 does nothing. The issue is that you’re feeding a list of sheets. You can use a code block with sheet[0][0] to get the individual sheet in your list, or you can use list level @L1 for the sheets input.

@sps.25788 You want a list. Use one of the 2 options below.

In Dynamo 2.0 amt is -1 by default.

Interestingly enough it seems to work with any list structure, so your problem might be something else.

The idea is select sheet in revit instead of Dynamo, so I used sheet select and then copy using dynamo. So that individual can not go to Dynamo to feed sheet selection. Data shape node give dialogue box to select a sheet. If you have better idea to do that please suggest.

What I’m saying is that the sheet list structure shouldn’t matter in this case. I’m able to run the exact same graph successfully. You might try updating your Data-Shapes packages as it looks like you have an old version.
The error makes it sound like there is no element with the Id you’ve selected. You can always try closing Dynamo and reopening again.

Even I can able to run graph successfully in some files. I would say some newly generated sheets can be duplicate using this graph. But when I use script for some old files it gives some error. And you are right reopening again sometimes works perfect.

Is it possible to show number and name? I can swap between the code blocks, but can´t get both listed in my watch note.