Edit List.Contains list structure using List.GroupByKey?

Hi I have used List.Contains to filter a list of all the views in a project (1) by a select list of views I want to use (2). I then want the resulting filtered list (3) to match the list structure of another list (2). Please see below.

I’ve tried Group.ByKey but I may be missing something. Do I need to approach this completely differently? Any help much appreciated.

I think you would need to used List.Contains in cross product mode the way you have it set up. This would take a long time and can be done a better way.

What are you trying to do / what is your end goal?

Thanks for your reply. I agree cross product isn’t very efficient. The graph uses a dictionary of keys (sheet numbers) and values (views on those sheets).

The end goal is to get a list of views per sheet, so the list of views output (3) needs to match the list structure (2).

Is this what you are trying to do? Sheet.GetViewportsAndViews will get all the views on a sheet. (if the sheet has not views and empty list in returned) The node is from the rhythm’s package.

Not quite. I’m looking to arrange a list of views that will be placed onto an empty sheet. So my issue is with the list structure

Can you show more of your graph?

I think the node you need is If Equal Return Index Updated (stand alone package with the same name as the node)

Index of perhaps?

Thanks again for your replies.

@Steven Unfortunately I cannot seem to find the node you’re referring to.
@jacob.small IndexOf works perfectly thanks! See below.

So in summary the graph aims to use a selected number of sheets and report the corresponding views to be put on sheets:

  1. Excel workbook with a list of sheets and their corresponding views is used to create a dictionary.
    2a. Select sheets
    2b. The sheet numbers are used to search the dictionary
    2c. and return the actual revit views needed.
1 Like