Duplicate placed families with Dynamo

Hi again guys,

I’m placing families with Dynamo. The next step is to duplicate these placed elements and give every instance a new name.

The script I made places lettels in linked elements. Now I would like to duplicate every instance and rename it. I think it’s possible to start the duplicate at the FamilyInstance.ByLine node?

Is this even possible or should I forget it?

Thanks in advance!!

image

image

I’d start at the nodes right before that, and use a List.OfDuplicateItems to duplicate the list of lines you used to create the first instance. Set your list levels and lacing (@L2 for the lines and longest lacing if I am not mistaken) and see if that gets instances atop instances. You may want to use a different family type as well, in which case build a list there and use @L1 (might be wrong here so test it out) for that input for the FamilyInstances.ByLine node.

I can’t find the list.ofduplicateitems node. In what package is it?

Right now the script makes every lettel L1. What I’m trying to do is to duplicate every lettel with another length.

Sorry for that typo - it’s List.OfRepeatedItems, as shown here: Dynamo Dictionary.

But what can I do with it. I know repeating my list, but I can’t find out how I should duplicate my families from there.

Duplicate all the inputs into the node which created the family instances.

This will not only give you the duplicate elements but make your graph faster due to less ‘trips to the well’. What I mean by that is it reduces the number of interactions with the Revit model, to only creating things once, rather than creating things, getting things, then creating things a second time.

So, this is the node that I’m using to create the family instances. What should I do from here on?

Error is saying: Warning: List.OfRepeatedItem expects argument type(s) (var, int), but was called with (archilab.Revit.Elements.FamilyInstances, string).

Thanks for the help!

The List.OfRepeatedItems node should come before that node. Specifically in the red boxes in this marked up version of your prior graph:

You may find you also need a List.Flatten node after the of repeated items, but I cannot confirm just yet as I don’t see your list structure.

Thanks, I will try it out tomorrow. Should I give the node an amount or how could I use this?

you want two families - the one you were already placing and a second one, so it follows that you’d use 2 as the numerical input (0 returns an empty list, and 1 returns the list as it is with an extra list level if I’m not mistaken).

Hmm I’m trying to duplicate the existing family that is placed. Do you think you get that? Because I think it will place two families at at the same place.

I’m getting an error when I try your example.

To confirm: you have a graph that places a family, then you want another copy of the family with a new name in the exact same spot.

Do you want a new family type or is there an instance parameter? If the later than Element.SetParameterByName after your FamilyInstances are created should work. If the former than duplicate your type first, set the parameter values, then feed a list of both types when you create the instances.

Please post a workable rvt and your current dyn with your next reply so we can be on the same page.

1 Like

Hi @Temmink

Watch out for amount input at List.OffRepeatedItem. Input type is double not string. Currently you’re feeding as string.

1 Like

Yes, I want to place a duplicate, but it should delete the other family (or dupe indeed).

The script should duplicate the family by itself, it doens’t exist in the project.

I can’t sent you a workable rvt and dyn, because It’s work related, sorry.

Maybe I could try to make a workable file.

Hi @Kulkul

I don’t understand why that matters? What should I change if I would like to do that?

I’m trying to duplicate the type names (L1) to L2, L3 etc. for every placed family in the project.

I don’t know if it’s the right way, but I tried to duplicate it with the FamilyType.Duplicate node, but It’s giving a null.

image

Bump