How to create separate assemblies of each element in a list


#1

Hello,
I have a list of elements. How do I create individual assemblies of each item? I am using the Tools.CreateAssembly node but that takes all the elements and makes into one assembly.
Thanks


#2

Please provide image / example


#3

The script is filtering down to only the structural elements that I need to have an assembly created for. As shown, I even tried using “List Chop” to separate each element into separate lists, but it still consolidates them all back into one assembly.

Thanks for your time!


#4

Try enabling levels, @@L1.


#5

Jacob, please provide further information on how to do this. I tried enabling levels under both the “Filter Element List by Parameter Value” node and the “Tool.CreateAssembly” node and it still consolidated all elements into one assembly. So not sure if this is what you meant to try.

Thanks


#6

I meant at the create assembly node.

You could also try setting lacing to longest.


#7

I tried using List Map. It worked once. But then had issues with multiple identical elements and locking up during the process.


#8

Old school. I like it. :smile:


#9

Yeah. Setting the lacing to Longest worked also, but it to, locked up when there were two identical elements. I need to figure out how to get it to ignore duplicates and move on or at least treat it like Revit does when one assembly matches another. Any guidance would be appreciated.


#10

List.Unique beforehand maybe?


#11

Hi @staylor,

Does the top part of your script work properly (Tool.RenameAssembly) ?
If you have identical elements, the “Mark” parameter should also be identical for these elements.
Maybe you can check if this is true.

Kind regards,
Mark


#12


Broke this up to make sure it was legible. Everything works now except for the “Tool.AssemblyViews”. It pulls in all of the elements correctly and weeds out the duplicates. Then creates an assembly of each element and names each assembly appropriately. However, for some reason, the script locks up when it tries to create the assembly views. I have that part frozen in my second view.

Thanks for everyone’s so far.


#13

Found out why it crashes. I have two pieces exactly the same, so it made both an assembly and gave both the same assembly name. So technically there were more assembly instances than assemblies. So it confused the AssemblyView creator.


#14

Nice work!


#15

Thanks!
Again, I appreciate everyone’s input!


#16

Okay, not sure if I need to start a new thread for this. I am trying to fix the issue about Assembly.Views crashing as stated above. Does anyone know how to get and set parameter values from an assembly?


#17

Hi @staylor,

Here’s my workflow (a lot similar to yours i think).
It creates an Assembly Instance for every Generic Model (Family Instance), but it only creates a sheet and planview for “unique” Assembly Instances.
At the bottom a added two examples on how to edit parameter values.


Generic Models_Create Assembly_v03c.dyn (26.7 KB)

I hope it can be of help.

Kind regards,
Mark


#18

Mark,
Thanks for the suggestion. Unfortunately, I need the elements instance parameter values and the Element.Parameter node doesn’t pull that information from an assembly. Or at least it doesn’t when I tried it.


#19

Hi @staylor,

Have you solved it ?
If not what are the parameters you are looking for ?
The default instance parameters or custom parameters.

Kind regards,
Mark


#20

Mark,

I need custom instance parameter values. I have a work around using third party software, but any input to resolve my issue with the script would be welcome.

Thanks