Creating list with linked rooms and host families (mechanical equipment)

Hey guys, im pretty new to Dynamo. In fact this is my first attempt at it.
The title above is pretty much what I want to do, and I hit a road block. I downloaded a few very helpful packages that allowed me to get elements from my linked architectural model, and it creates a list of numbered rooms (i.e [0] Room 1327517) but I want a list of the room names, so I use element.getparametervaliebyname and use a string with “Name”. I create a separate line starting with categories then all elements of category (Mechanical Equipment). Up to this point its great.

Problem occurs when I use elements in room. At this poing it gives me the line of code where the error occurs and then AttributeError: ‘str’ Object has no attribute ‘area’. This error does not occur if I dont do the extra step to get the name.

Any ideas on how to create this list shoding in a single column the linked room and families placed over them
(i.e. Living Room
Sofa
table
TV stand

A capture of the graph would be helpfull here to help us help you.

If I understand correctly:

The error you are getting is, I beleive, expected behavior. STR means “String” wich is basicly text characters. So if you are feeding text in a node that needs rooms, it’s going to shout that error.
Have the Element In Room, fed by the room elements, and have the name parameter go in a different branch.

The Name of an element is a very different object than the actual element. But, as long as you dont sort them, the lists stay ordered exactly as their predesessors.

While possible to get a list that would show [ROOM, ITEM, ITEM, ITEM], it’s inneficient. I’d much rather like to have two lists:

[R1, R2, R3]
[ [ I11, I12, I13 ], [ I21, I22, I23 ], [ I31, I32, I33 ] ]

Each sublists of the second one representing a room.

With that raw data, you can export to XLS and play around in a cross dynamic table to get the feel you want.

But I’m extrapolating, tell me if any of this helps.

Below is a screenshot of the branches I have so far. I removed the get parameter by name and replacing it with room.name. The top example shows room names and equipment in two lists, but when I try to extrapolate by elements in room I get the object has no attribute ‘area’. The test below I am able to get the list I am looking for, but it does not show the room name on the list.

Hey that’s what I thought.

The “List” indicator cannot be changed, it just tell you that these elements are in a list. This is hardcoded and expected behavior.

The top one doesnt work because you are feeding text in a node that ask for a room, the name is only the parameter value and does not represent the room as a whole. Basicly, if there is a green number, it represent a revit element; if not, it’s just data.

Now it all depends on what you want to do with this data, export to XLS, CVS, TXT? back in some parameter in revit? What is your end goal?

Right now you have, as I said before, two lists
Rooms: [R1, R2, R3]
Items in rooms: [ [ I11, I12, I13 ], [ I21, I22, I23 ], [ I31, I32, I33 ] ]

You could, for example, put a set parameter by name to go through your items and write the room name or number in a comment parameter. Then, do a normal Revit schedule.

Or export the thing to XLS and read it in excel, but this does demand to play aroud with your data.

Other than that, I higly suggest you go through the Dynamo primer, it’ll explain much of those little things that seem so alien.

Thanks for all the quick feedback. In the end what I want as a result is to create an excel list with at least the room name the equipment name (ID number) contained within that room. Only detail is that since the rooms are from a linked model I am having trouble listing both one under the other. Through Revit schedule I can list them but side by side as separate lists (not recognizing which equipment is in each room). From what I was able to see, what I need is the opposite from Archi.Lab’s (Elements from linked file in room) node.

ok, so, an xsl that says ( I know it’s not exactly as your above post requested, but bear with me)

ROOM_1 | ItemID_A | ItemName_A
ROOM_1 | ItemID_B | ItemName_B
ROOM_2 | ItemID_A | ItemName_A
[…]

I believe you already have everything you need; from your second post, I see you have a list of list, representing items by rooms and before that, you have a list of rooms

From the ITEMS’ list, go off two branches and GetParameterValueByName to get you ID and Name as strings. They should have the same list order as your item list.

Then, from your Item list, start a COUNT node at LVL2, it will tell you how long each sublist is. We need this because next, you will feed your ROOMS’ list into a CYCLE node, giving it the result of the COUNT. This should out you a list of rooms with the same format and lenght of your item list! So if your Item list looks like this: [ [ i, i, i ], [ i ,i ] ] and room list like this [ r1, r2 ], the output should be [ [ r1, r1, 1r ], [ r2 ,r2 ] ], finally, get the rooms’ names.

So, three lists of strings (text) of equal lenght and form. Run each of them in a FLATTEN node, this will lose the whole “sublist” thing while keeping it in the same order.

I’m going from memory here but, excel has a scpecial way of wanting data input, it want it line by line. So we want to feed him something like [ROOM, ID, NAME] to make a full line. Feed your 3 new lists in a LIST CREATE, wich will out you a single list containing your three lists. Feed that in a LIST.TRANSPOSE, to get the form I explained earlier.

Fill out whatever info the excel node need and give him your data. Keep that raw data as is, and make a cross dynamic table on a new sheet, filter it as you like. ( because with the CDT you could also sort it by item or ID instead of rooms, a bit like a revit schedule.

However, if you really want the form you posted last, I invite you to play around with the lists-making and figuring it out. It’s part of the fun :slight_smile:

So heres how far I was able to get with the latest tips. I didnt get the same amount in each list when applying the count node. Since I have rooms with no families and I have repeated instances in each room, I get a number that is the multiplication of families and rooms. I needed a way to set a count of each family in each room.
See below.

.

One reason I think it isnt working is because elements in room filters list to rooms with elements, and the get all elements from linked mode did not. In irder to create the 3 lists with same amount it would be necessary to find a way to filter empty rooms from the get all elements from linked model

@oliver.goulartyoung

Alright buddy, had loads of free time this morning, you’re in luck. I figure the info I told you wasn’t quite exact, so I’m redeeming myself by being more clear. Here is the beast you most tame:

Element in room.dyn (48.3 KB)

I tried to be clean and specific, while explaining myself as much as possible to help you in the future as well.

So, using a model that looked like this:


Beautifull isn’t it?

The script OUTed this in excel:

Wich became this after the whole Cross Dynamic thing, wich is a beast of it’s own:

This should be close enough to something you can use, fiddle with it, have some fun and try to reverse engineer it as much you can. My deffinitions are far from perfect so take it with a grain of salt.

Cheers!

Element in room.dyn (48.3 KB)

3 Likes

Truly magnificent what a select few can do with some spare time. This looks great, thank you so much for this beautiful beast!

1 Like

I tested out the beast dyn file. you sent, and it works great. Just one issue with the elements in rooms that im trying to work out on another thread. Elements in rooms isnt recognizing the elements in their correct rooms (from linked background architectural file). Reproduced your example by creating test rooms in the actual file (not linked) and it worked for them.