Delete part of rebars in Set Number with Spacing

Hi everyone,
Maybe someone here could help me with a Dynamo script. I mainly work with 3D reinforcement. I wanted to create a script that removes every second bar from a rebar set that was placed using the “number with spacing” option.

The problem is that Dynamo nodes cannot extract the geometry of those bars because physically it is only one bar that Revit copies visually. It wont be a problem if can explode set and will do single rebars. Unfortunately I have to stay the same one set and modify inside.

I wanted to get a list of those bars, but I can’t access the IDs of the “virtual bars.” I thought the List.Flatten node might help, but unfortunately it doesn’t.

I also tried writing some Python code, but it only returns the assigned rebar IDs without their geometry.

import clr
clr.AddReference(‘RevitAPI’)
clr.AddReference(‘RevitServices’)

from Autodesk.Revit.DB import *
from RevitServices.Persistence import DocumentManager

rebar = UnwrapElement(IN[0])

count = rebar.NumberOfBarPositions

lista =

for i in range(count):
lista.append(i + 1)

OUT = lista