if someones are interested, here my final script based on @Organon’s script for multiple copies of rebars containers from one element to others elements
multiple copies of rebars containers
import sys
import clr
import System
from System.Collections.Generic import IList, List
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
all_Shafts = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_GenericModel).WhereElementIsNotElementType().ToElements()
# get the remainder rebar hosts.
New_rebar_hosts = all_Shafts[1:]
# Get rebar containers.
first_rebarHostData = RebarHostData.GetRebarHostData(all_Shafts[0])
first_containersInHost = first_rebarHostData.GetRebarContainersInHost()
old_containerIds = List[ElementId]([c.Id for c in first_containersInHost])
# Get levels for remainder rebar hosts.
levels = []
for host in New_rebar_hosts:
level = doc.GetElement(host.LevelId)
levels.append(level)
TransactionManager.Instance.EnsureInTransaction(doc)
new_containerIds = []
for l in range(0, len(levels)):
t = XYZ(0, 0, levels[l].Elevation)
containerId = ElementTransformUtils.CopyElements(doc, old_containerIds, t)
new_containerIds.append(containerId)
new_containers = []
for i,j in zip(range(0, len(new_containerIds)), range(0, len(New_rebar_hosts))):
temp = []
for id in new_containerIds[i]:
container = doc.GetElement(id)
container.SetHostId(doc, New_rebar_hosts[j].Id)
temp.append(container)
new_containers.append(temp)
TransactionManager.Instance.TransactionTaskDone()
OUT = new_containers