Schedules - combining different categories

Schedules - combining different categories

Anonymous
Not applicable
15,598 Views
17 Replies
Message 1 of 18

Schedules - combining different categories

Anonymous
Not applicable

Hello community,

 

i may be trying to do something impossible here and hope to be wrong!

 

i`ve got two schedules for area calculation: a room schedule and an area schedule. The room schedule contains the room areas, the area schedule contains the gross floor area GFA. In order to find the structure building area, i would like to calculate GFA "minus" net building area (which means information from the area schedule "minus" information from the room schedule). What i acually want is to find a way of integrating the information from the area schedule in the room schedule so that I can apply a formula for the calculation. Is there any chance it would be possible? Maybe dynamo? 

 

Thank you!!

0 Likes
Accepted solutions (3)
15,599 Views
17 Replies
Replies (17)
Message 2 of 18

Anonymous
Not applicable

Absolutely! Dynamo is the way to go. Can you send a screenshot of your area schedule? I'll throw together a quick dynamo to demonstrate. 

Message 3 of 18

Anonymous
Not applicable

Thank you!

 

what i want to do is transfer information from an area schedule to a room schedule:

The first picture shows the area schedule with values for a Parameter called BGF.

The second picture shows the room schedule (only totals per floor) where i would like to show the BGF areas from the area schedule.

 

That looks like it works now because i created a room parameter called BGF and put the values from the area schedule manually in one of the rooms - which is wrong for 2 reasons: the BGF (gross room area) is obviously not the area of only one room. Second, I would like the parameter to be filled automatically... 

 

Any idea how to solve that?

Thanks a lot!!

 

 2018-12-12 17_15_23-Autodesk Revit 2018.3 - [Schedule_ Area Schedule - PPA_100_Teilmodell_01_fsa@auk.png2018-12-12 17_16_31-Autodesk Revit 2018.3 - [Schedule_ Room Schedule 2 - PPA_100_Teilmodell_01_fsa@a.png

0 Likes
Message 4 of 18

Anonymous
Not applicable
Accepted solution

If you were using spaces, duct systems, piping systems, or electrical circuits, you would be able to do what you're looking for by creating an 'Embedded Schedule'. Unfortunately, with Areas and Rooms, that's not possible via built-in Revit schedules.

 

This might be a bit of a learning curve, but you will find the Dynamo file attached.

I'm more of a programmer than a Dynamo-Professional, so I used a special Dynamo node (each self-contained box in the Dynamo is a node) called a Python Scripting Node to add in special scripts that take a simpler and more efficient approach. You can double click on the grey space towards the bottom of a Python node to view the script. I have comments in with the script and I wrote it as clearly as possible to help with readability. 

 

Also keep in mind the following things:

 - This Dynamo flows left to right, so you want to read it left to right.

 - For the Elements/Objects in the data peek/dropdown boxes that have green boxes next to the Elements, that green box is the Element Id and clicking on it makes your Revit application find the object/Element in a view and hover over it.

 - To understand the flow of data through the Dynamo, you have to first understand that most non-Python Script (or Design Script) nodes can take in single objects or lists... they don't care about the difference between a list and a single object/Element. If it's a single object that enters, I'll do the action to it once, and if it's a list, it'll do a 'for loop'...
basically it'll do the specified action to each Element in the list, then spit out a list of results.

 

Hope that helped!

0 Likes
Message 5 of 18

Anonymous
Not applicable

So I opened a file in Dynamo and it shows Under both "categories" and "All elements of Category" as "unresolved"  How do i succeddfully link my filled region with these two commands.

 

Also under SEARCH in Dynamo the "categories" and "all elements of categories" nodes are not showing up. Is it under different command/node now?

0 Likes
Message 6 of 18

Anonymous
Not applicable

Hello Katherine,

      I believe you may have opened Dynamo in it's own program instance instead of through Revit.

      You want to open it by opening a Revit project file & accessing it under the "Manage" tab (Dynamo ver. 2).

      If that still fails, please send an image of the 'unresolved' warning you're seeing and what version of Revit you're using.

      

Message 7 of 18

Anonymous
Not applicable

 

Hi there!

thank you for the reply. Yes that definitely helped!
My question now is.... I tried to opn the file here but Dynamo is showing
"Error opneing corrupted file c:-----the name of the file...."
Question1 why is it not opening it?

Questions2

I opened another Dynamo file on linking the filled regions to schedule
I am not sure how to link certain filled region (and not ALL filled region) to set up a schedule
How can I do it?

Here I attach the dynamo file and the tutorial i followed was this one

https://www.youtube.com/watch?v=kd53-ofHCgY

 

printscreen.png

0 Likes
Message 8 of 18

Anonymous
Not applicable

Que. #1 - 95% sure this is occurring because you are attempting to open the dynamo in Dynamo version 1.

                 The dynamo file I attached for Fabiana must be opened with Dynamo version 2.0 or later.

Que. #2 - To identify only certain filled regions, you will want to filter out all the non-applicable elements by

                 a certain parameter value. To do that, you would employ the same dynamo blocks/nodes that were used to

                 filter out filled regions from all detail items (blocks in red, using data from the block in orange instead of

                 the "All Elements of Category" node).

2019-07-22_9-27-33.jpg

                 Although, from what I can gather at this point, you're trying to use the dynamo in a use case that is very

                 much different from Fabiana's use case... and as a result, neither the dynamo you have provided, nor the

                 dynamo I made will work in your case without some substantial modification. Also, If you're just trying

                 to schedule filled regions, I would suggest dropping dynamo altogether and simply using the built-in

                 schedules. You should be able to pick out filled regions from a Detail Items schedule using the

                 "Family & Type" field. 2019-07-22_9-42-04.jpg

                 However, if you are attempting to do something more advanced, Dynamo does have a semi-steep

                 learning curve and you will not learn everything you need from me, especially while on the

                 Revit Architecture forum.

 

                 You can use this website to learn more about how to use Dynamo:

                 https://dynamobim.org/learn/

                 And you should try to aim your Dynamo questions at this forum instead of the Revit Architecture forum:

                 https://forum.dynamobim.com/

                 *You'll get a lot more of your questions answered that way*

Message 9 of 18

Anonymous
Not applicable

Is it possible to use Dynamo to create a schedule that includes data from both an Electrical Equipment category and from a Device category such as Nurse Call, Electrical Fixtures, Fire Alarm etc.? Revit 2017 MEP

 

Kyle K.

Apex Eng. Gp

0 Likes
Message 10 of 18

Anonymous
Not applicable

Hi James, would you be so kind and help me changing this node a little bit? I am not familiar with dictionaries, so I am bit stuck here… 

 

I was a bit concerned (because it happens a lot) that some projects would have only as many area plans as necessary for the gross area (max. 5) and as many floor plans as levels for the room area (say 50). In this case, we would get very different dictionaries, a long one for rooms (more keys) and a short one for areas, and the last bit would not work properly anymore because it could be subtracting areas from two different floors. What I would like to do is compare the keys, and say:

 

if Key (Level) in Dictionary A (Rooms) == Key (Level) in Dictionary B (Areas), then calculate the area of all Rooms of this Level in Dictionary A and paste it into a Parameter called "Rarea" in the first item (Index 0) of Dictionary B. The other Areas in the same Level in Dictionary B should be set to 0. Does it make sense?

 

I attached my Dynamo graph here for reference. Thank you very much!!

 

 

0 Likes
Message 11 of 18

Anonymous
Not applicable
Accepted solution

@Anonymous  

Yes! That would simply be a modification of the dynamos we've been throwing around so far. If you'd like to give it a try on your own, I can answer questions.

 

@Everyone 

I'm currently working on a Revit addin to allow anyone to easily combine schedules from different categories.

If ya'll would like to help me test it out that would be greatly appreciated. If so, just stay tuned, I'll most likely post about it on this thread.

 

@Anonymous Sure! First off... You've gotten yourself into a bit of a pickle because A. Dictionaries can be a bit tricky to use, so I just avoid them and stick to lists & B. just knowing that you're using dictionaries doesn't clear up all the issues because the dictionaries that Dynamo uses (through the blocks... outside of the Python node) are different from the standard dictionaries used within Python.

 

Okay, this'll be a bit of a roller coaster, so hold on tight!

 

1. Dynamo Error ('iteration over non-sequence of type Dictionary')

The following error is indicating that you can't "Iterate" over a Dictionary :

2019-11-21_14-38-52.jpg

 

And it's pointing to line 11 of the code. 

2019-11-21_14-40-05.jpg

 

 And this is a perfect example of why I don't like dictionaries. For one, they can't be looped over because they have no intrinsic 'order'... there's no 'first' or 'last' item... so a loop can't iterate over a dictionary. A dictionary is really just a jumble of items we'll call pairs that have no idea how they relate to each other... no intrinsic association... no indexes. Each pair just has a key(string) that's connected with a value(integer, double... etc.) and you can ask the dictionary to get you a particular value in a pair... but ONLY if you already know the key that you're looking for.

So i'd suggest avoiding dictionaries if you can, but we'll make them work for now. 

 

 

2. Dealing with the mismatch between Level counts for Areas/Rooms

From what I've gathered from your question, your core issue is that there may be rooms for levels 1-4 (for example) but only areas for levels 1-3... and the dynamo would freak out because there isn't a perfect 1-to-1 correspondence between the Room levels & Area levels. Well, one simple solution to this problem is to simply feed one list of dictionary keys into both "Dictionary.ByKeyValues" nodes (preferably from the list with less keys)... that way they should have matching keys. 

2019-11-21_15-55-59.jpg

 

In this example, we feed the keys for the Area dictionary into the Room ".ByKeyValues" node... so all pairs in the Rooms dictionary that weren't ALSO in the Area dictionary were dropped. Sort of a filter...

 

 

3. Finding a way to loop through these dictionaries and do our arithmetic 

So, like I mentioned before, dictionary values can only be found if you already know the key you're looking for... so we'll feed in the same unique keys list from the smaller Areas dictionary that we used to filter the Rooms dictionary just above.

2019-11-21_17-08-44.jpg

 

Now, I've made the following modifications to your code... Green = additions & Orange/Yellow = changes:

20192.jpg

 

- First change (lines 7-8) I didn't highlight, but I removed the "UnwrapElement()" calls from the input. Leaving them doesn't hurt, but it also doesn't help. There's nothing for it to do so it just does nothing. It can only convert Revit element types from what Dynamo can interpret to what python can interpret... so it does nothing with a dictionary.

- Next, (line 9) I specified the list of unique keys that we KNOW appear in both the Areas dict and the Rooms dict as "levelKeys"... because those are they keys we will be searching for within the two dictionaries.

- Next, (line 13) I modified the loop to loop over the list of keys('levels') instead of the dictionary which it couldn't do anyways.

- (line 15-16) I added variables that would serve as the total calculated areas per level... one for the Rooms and one for the Areas.

- (line 18) I modified the object which the loop iterates over... making the loop iterate over a list of all the know values that correspond with the 'LevelKey' variable within the 'dicrooms' dictionary. As I mentioned earlier about how Dynamo dictionaries are different from Python dictionaries.... this means that they have their own special way of pulling values matching a given key out of them. Those special ways of extracting values are badly documented online, but they are documented here: https://primer.dynamobim.org/09_Dictionaries/9-3_Code-Block-Uses.html
The last image on that page shows a list of methods and properties you can call (methods and properties are essentially anything that requires following the object with a period like "dictionary.Count"). So, that documentation states graphically and very loosely that we should use ".ValueAtKey(key)" to get the values in the dictionary that are found on a specific level.

- (line 19) Has two modifications... one to finally unwrap the Revit element and convert it from Dynamo form to Python room. This time it WILL have an effect because it's the actual room object itself rather than the dictionary containing the room objects. The second change is from ".Double()" to ".AsDouble()" as the Revit Parameter Object requires you to call it's '.AsDouble()' method to return a floating point value. Here are the docs for it: https://www.revitapidocs.com/2018.2/c0343d88-ea6f-f718-2828-7970c15e4a9e.htm
- (lines 20-24) Simply a repeat of the above few lines of code but running over the Areas instead of the rooms and adding each one's total to the running totals in lines 15-16.

- (lines 26-27) Finally find the difference between the total Room area and the total Area area for this specific floor and add the result to a running list of floor area differences at line 11.

 

 

4. Interpreting the Results

Now, if you were to run this dynamo, all you would see out of your Python Script node is a list of numbers. I'm guessing you also want to see what levels those numbers correspond to as well, so we can simply add another node after the python script that pairs each item in the list with each LevelKey that we sent into the Python Node like so:

2019-11-21_17-53-46.jpg

 

And now we get a list of area differences per floor that we can easily interpret:

2019-11-21_17-56-14.jpg

 

The modified dynamo is attached to this reply, and if you have any questions, feel free to ask.

Message 12 of 18

Anonymous
Not applicable

Brilliant! Thank you SO MUCH! It helped a lot and I also learned a lot!!!

 

I just would like to change the output a little bit, it is not quite exactly what I need yet.

I would like to paste the summ of the room areas by floor in an area Parameter called "Dynamo NRF" on the same Floor.

 

I changed the python node a Little bit, divided the total room area by the number of Areas in the same Floor and combined the two lists. What I would like to do now, (I imagine Dynamo nodes would be enough?) is paste the value of index 0 in the Elements contained in index 1, 2 in 3, 4 in 5fsa.png and so on... Would that be possible?

 

Thanks again!

0 Likes
Message 13 of 18

Anonymous
Not applicable
Accepted solution

@Anonymous Okay, cool! I think I understand now. 

So you're trying to map the calculated values from each level back into the Areas that made up that level. Like This???

2019-11-22_14-06-41.jpg

 

So they'll appear in an Area schedule without going blank from conflicts when you deselect "itemize every instance".

If that's what you're trying to accomplish, then yes, that can be done with the dynamo nodes (as well as within the python code)... although it will require some modification to the structure of our data either way. I don't have a ton of time at the moment, so here's the summary.

 

The main issue is that... to make use of the built-in dynamo node "Element.SetParameterByName" you need to have a perfectly parallel list of area elements along side a list of the values you wish to set for each of those elements. So you'll have to re-map the relationship between your values and elements. I made the following changes to your code:

2019-11-27_14-06-52.jpg

 

 

These code changes will result in two lists (gesamt and ids) with perfectly equal lengths.... and the value from index n of 'gesamt' should correspond directly to the area object at index n in the 'ids' list. The gesamt list will contain a bunch of repeated values, but that's good... as long as both lists have the same length. Then you can simply feed in both lists to the 'SetParameter' dynamo node... and internally it will loop through both of them in parallel. Here I used the "GetItemAtIndex" node to separate out the two lists when they exit the python script node... because putting a comma to separate them like I did causes the two separate lists to be combined into a list of two lists. These nodes then re-separate the lists:

2019-11-27_14-09-31.jpg

 

I've also attached your original dynamo that I modified.

 

By the way, I was not able to verify that this worked perfectly because your model is obviously a bit different than the one I'm using and I didn't go to the lengths of recreating your parameters. If I were you I would double check the area calculations the dynamo is doing by hand... at least once or twice. There may have been arithmetic errors along the way that still need to be ironed out or you may need to convert between units before saving the values into a parameter. Just something I typically do to double check my work.  

0 Likes
Message 14 of 18

Anonymous
Not applicable

That works perfectly well, thank you very much!!

0 Likes
Message 15 of 18

Anonymous
Not applicable

Can this be done without using another complicated application?

0 Likes
Message 16 of 18

Anonymous
Not applicable

Unfortunately not - at least so far I know. 

0 Likes
Message 17 of 18

ljamacnab
Explorer
Explorer

Hi @Anonymous 

 

I don't suppose you made any progress with the Revit addin to combine schedules from different categories? It would be a game changer if possible! 

 

Cheers,

 

Luke

0 Likes
Message 18 of 18

Anonymous
Not applicable
Nope, switched industries to Telecom.
New set of tools (and problems) over here.
0 Likes