Set host

hi
i am trying to set new host for rebars the problem I getting an empty list

rebarElements = UnwrapElement(IN[0])
hostElements = UnwrapElement(IN[1])

for rebar in rebarElements:
	list = []	
	for host in hostElements:	
		x = rebar.SetHostId(doc, host.Id)
		list.append(x)		
OUT = list

answered on the other topic where u originally came up with this question:

so i guesst it should work like that if i have set of rebars and i wanna copy them to 2 different host elements?


rebarElement = UnwrapElement(IN[0])
hostElement = UnwrapElement(IN[1])

#for hostElement in hostElements:
for rebar in rebarElement:
	for host in hostElement:		
		rebar.SetHostId(doc, host.Id)
OUT = host

This will not work with SetHostId as it only changes the HostId and does not copy the RebarElement.

Copying Reinforcement to another HostElement is a much more complicated topic maybe u can find some answers here:

1 Like

sorry i already managed to copy the Rebars to the elements i just wanted to rest the HostElement(get the new host elements) let’s say i have a beam with rebars, and i wanna copy the bars to 3 or more beams at the same time :slight_smile: