Add subcomponents to Assembly with Assembly.AddMembers

Hi! I wrote a script, it works but doesn’t change anything. What I do wrong?
All in dynamo window works but Assembly.AddMembers doesn’t really add members into my assembly. So I get members from selected assembly, get their subelements and try to add them to assembly too using clockwork

@stepanste It looks like you are trying to add nested families to your assembly, is that correct?

EDIT: I was incorrect on assuming the assembly would include a family instances’ subcomponent after I checked just doing it in Revit alone… tricky. :thinking:

Perhaps knowing your end goal will still help to find a workaround, if adding them won’t work via Dynamo

@awilliams yes, I want to see all of the nested families in me assembly including specifications (and I want to check them in the right part of the screen) and they are not there like all nested families they need to be included manually or about this way. And when I try to make separate screw and add as a member by the same way it doesn’t work too.

@ I found in that there are 2 solutions. The first one is to add a visibility property to nested families and the second - try to do it with the dynamo. The first one is simple but… doesn’t work in my case I don’t know why. I tried to make this property, hide, add contained family, then unhide them but there was still out of assembly

I took the Python script out of the custom node to see what error was being thrown - it appears these nodes are expecting sublists, so connecting your list of subcomponents to a codeblock like this {elements}; and then hooking that up to the Assembly.AddMembers node should work:



:clap::stuck_out_tongue_winking_eye: super! It works! But I don’t know how to replace “Select Model Element” with list of objects. So it will be more useful

1 Like