Duplicating items in sublists

Hi all,

Wondering if anyone could help me fix this issue i have been getting / help me write a work around

I am currently writing a that places boxes on clashes between walls and ductwork in Revit, it was working on my small scale model but now as I have ran it on a live project I am getting the issue where the duct is clashing with multiple walls and now the parameter read on of the ducts no longer lines up with the correct box. This is where i need help, I am looking for help writing some code that will duplicate the duct according to how many clashes it has been found with (the solid).

My current attempt is using a IF statement that will allow the process to pass if there is only 1 of the clashes attached to the duct but if it does not then I am trying to get it to take the item that it has counted to and then times it by the occurances of the clashes.

My current attempt looks like this.

Any help would be greatly appreciated.


@XalhanB Please post your rvt and dyn files or a link to them.

List.Count with longest lacing and List.OfRepeatedItems with correctly set levels should make quick work of this.

So am I doing this in the correct way and aslong as i play around with the levels i should be able to use this script without much changes?

Hard to know as we don’t have any data previews enabled.