I have a list of viewports and i want to sort it so that all Legends are at the end of the list.
I can identify the Legends by the view name or by the family type, i can also sort the viewnames and the types.
But i have no idea how i cant sort the viewports themselves. My attempt at list mapping failed.
You’ll probably want to use SortByKey to sort the Viewports based on the name or type. You might also need to convert the type to a value that you can control for positioning, like a number. You can do this with a nested If statement for each type or create a dictionary.
You can also do it @sovitek’s way of checking for the specific type. In that case you can just separate legends and non-legends with a filter and reorder them since it sounds like you don’t care about the order of the rest of the items.