Results 1 to 6 of 6
Like Tree1Likes
  • 1 Post By amoursol

Thread: How to combine SortByFunction with SortByKey

  1. #1
    Junior Member
    Join Date
    March 16, 2017
    Location
    Malaysia
    Posts
    16
    Current Local Time
    01:05 PM

    Question How to combine SortByFunction with SortByKey



    I want to sort list by Level Name (top nodes), but I want the level to be sorted by Elevation (example as bottom nodes). Can I sort these in one shot? (I understand that I can sort list by adding elevation parameter value, but I prefer not to do that way). Thanks.
    Attached Thumbnails Attached Thumbnails How to combine SortByFunction with SortByKey-sortbykeysortbyfunction.png  

  2. #2
    Senior Member amoursol's Avatar
    Join Date
    November 21, 2012
    Location
    London, United Kingdom
    Posts
    550
    Current Local Time
    01:05 PM
    Hello Mimi,

    Have a look at the following example using Function.Compose.

    If you want to understand how it works, go to my post entitled 'Wrangle That Data: Dynamo Filtration and Sorting'

    Attached Thumbnails Attached Thumbnails How to combine SortByFunction with SortByKey-revitforumquery_function_compose.jpg  
    josephpeel likes this.

  3. #3
    Junior Member
    Join Date
    March 16, 2017
    Location
    Malaysia
    Posts
    16
    Current Local Time
    01:05 PM
    Dear Sol Amour,

    I dont get same result as yours.

    Anything wrong here?
    Attached Thumbnails Attached Thumbnails How to combine SortByFunction with SortByKey-funtion.compose.png  

  4. #4
    Senior Member amoursol's Avatar
    Join Date
    November 21, 2012
    Location
    London, United Kingdom
    Posts
    550
    Current Local Time
    01:05 PM
    Hello Mimi,

    You're totally correct. It's a bit odd as mine worked last time I tried! As an alternative, the solution below should work for you:

    Attached Thumbnails Attached Thumbnails How to combine SortByFunction with SortByKey-revitforumquery_sortingbylevels.jpg  

  5. #5
    Junior Member
    Join Date
    March 16, 2017
    Location
    Malaysia
    Posts
    16
    Current Local Time
    01:05 PM
    Dear Sol Amour,

    Thanks.

    I still dont get same result as yours.



    Need to remove some nodes to make it working.



    I am still working on to solve problem in my first question anyway.
    Attached Thumbnails Attached Thumbnails How to combine SortByFunction with SortByKey-sortbylevelnotworking.png   How to combine SortByFunction with SortByKey-sortbylevelworking.png  

  6. #6
    Senior Member amoursol's Avatar
    Join Date
    November 21, 2012
    Location
    London, United Kingdom
    Posts
    550
    Current Local Time
    01:05 PM
    Dynamo natively will organise the 'Level Name' by alphanumeric characters. So you will want to organise first by name, then by level (i.e 'C' for Ceiling comes before 'L' for 'Level 0').

Similar Threads

  1. parameter < family type....> combine with and if statement
    By Bross in forum Structure - Family Creation
    Replies: 4
    Last Post: January 5th, 2016, 06:24 PM
  2. new to revit- combine text
    By mander2323 in forum Tutorials, Tips & Tricks
    Replies: 17
    Last Post: March 4th, 2014, 04:41 PM
  3. Combine 2 filled regions
    By Jock in forum Architecture and General Revit Questions
    Replies: 3
    Last Post: November 27th, 2013, 02:52 PM
  4. Combine WSM Add-In on External Tools panel?
    By DaveP in forum Architecture and General Revit Questions
    Replies: 0
    Last Post: June 26th, 2013, 04:58 PM
  5. Combine V Ph Hz in one Schedule Header?
    By tzframpton in forum MEP - General
    Replies: 2
    Last Post: May 31st, 2013, 08:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •