Room contain more than one ceiling

Hi,
i am new at dynamo please help me to add room name to ceiling if the room contain more than one ceiling it doesn’t work what is the solution

Can you expand the view? I don’t see where you are getting the error. Seems you are pulling and pushing the data fine.

the problem that the first room contain 2 ceiling but the name of it get in the one of them only the first one in the list the other one remain empty with no room name and i don’t know how to add this option in my script

@hagar27 Please post your dyn (or a link)

Have you tried to set the level of element in Element.GetParameterValueByName and Element.SetParameterByName to @2?
If taht doesn’t work, I’m sorry mate, can’t find a way to do it without using Dynamo only. So here is my approach, but if someone more knowledgeable has any other solution, it is more than welcomed.


Here is the snippet:

ceilings = IN[0]
rooms = IN[1]

ceilingList = []
roomList = []

# Place your code below this line
i = 0
for ceiling in ceilings:
	if isinstance(ceiling, list):
		for c in ceiling:
			ceilingList.append(c)
			roomList.append(rooms[i])
	else:
		ceilingList.append(ceiling)
		roomList.append(rooms[i])
	i += 1
		
# Assign your output to the OUT variable.
OUT = ceilingList, roomList

@salvatoredragotta here is my script room name in ceiling.dyn (9.5 KB)

@architectcoding i tried to adjust level @2 but it doesn’t work it gives wrong room names in the ceiling.
as i am not familiar with python yet ( still learning) , i tried python script but i can’t adjusted with my script as when i entered this code it couldn’t define the list name as ceiling and room thank you for your help

Well, there you go:

room name in ceiling solved.dyn (24.8 KB)

1 Like

Sorry mate, you don’t have to use python, maybe it was an overkill. Here is the solution with just dynamo:

Capture%202

2 Likes

thank you so much it works

the file doesn’t open , it gives me this message
image

Sorry about this one, can open it on my side, not sure why it is corrupted.
But anyway, it contains what you can see in the graph and the script snippet and also you have solved it with dynamo.

no problem thank you