GroupByKey Problem Using Sheets as Key

Hi,

I am having an issue that I hope is simple to solve.

Context:

I have 2 sheets that have multiple revision clouds with comments that act as “version” numbers that I want to populate the title block with.

Sheet 1 Revision Cloud Comments:

00A
00B
00C

Sheet 2 Revision Cloud Comments:

00A

Problem:

I want to group these “comments” by sheet. So that the list structure looks like this:

List
| [0] List
0 00A
1 00B
2 00C
| [1] List
000A

I’d like to then choose the last comment in each sheet to populate the title block. However, I am getting an error “Warning: List.GroupByKey operation failed.
Number of items does not match the number of keys.”.

Any ideas on how I can achieve a list that is grouped by sheets?

Sample Revit Project and Dynamo file can be found at this link:
https://drive.google.com/drive/folders/0B8jARoP5hB9qUHpxbll1bm8yTHc?usp=sharing

Thanks in advance.

Hi Erik,

Thank you for the quick reply. Your grouping method was perfect. Here is the solution I came up with to being able to updated the title block with the latest Revision Number (comment parameter of cloud) and Version Number (mark parameter of cloud) based on the revision clouds that are placed on the sheet.

Hopefully this is useful to someone who may experience a similar challenge.

Thanks for the information. I agree, I think this graph can be further optimized, especially with extracting and sorting the parameter values of the most recent revisions and versions. However, this was the best I could get to solve the issue at hand with my knowledge :relaxed: The “RemoveNull” feature is definitely something I will use in the future, however some sheets do not have version but have revisions and vice versa. This probably wouldn’t have affected the script but I was in a rush. Thanks again!

Title Block Sheet Revision by Revision Cloud.dyn (28.5 KB)

Title Block Sheet Revision by Revision Cloud Reduced.rvt (2.4 MB)

Shared Parameters.txt (722 Bytes)