What is the method that Revit used to sort a sheet list?

What is the method that Revit used to sort a sheet list?

Shai.Nguyen
Advocate Advocate
1,011 Views
2 Replies
Message 1 of 3

What is the method that Revit used to sort a sheet list?

Shai.Nguyen
Advocate
Advocate

Hi all,

I have a question. I tried to access all sheets in document and sort it by sheet number following the order of Revit.

Here is the result compare with my sheets list and Revit sheets list:

question1.JPG

My code is:

List<ViewSheet> sheetList = new FilteredElementCollector(doc)
                .OfClass(typeof(ViewSheet))
                .Cast<ViewSheet>()
                .OrderBy(x=>x.SheetNumber)
                .ToList();

Can anyone teach me how to sort exactly like Revit?

Thank you in advanced!

0 Likes
Accepted solutions (1)
1,012 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Accepted solution

This iis more complex that you might think, since a user can sort the project browser any way he wants. So, if you want to duplicate it, you have to figure out what kind of filtering the user uses.

 

have a look here: http://thebuildingcoder.typepad.com/blog/2014/04/whats-new-in-the-revit-2015-api.html#3.13

Message 3 of 3

Shai.Nguyen
Advocate
Advocate

Thank you so much!

0 Likes