MONUMETRIC Video mmt-volt

Collapse

How to combine SortByFunction with SortByKey

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mimi Azimar
    Junior Member
    • March 16, 2017
    • 16
    • Malaysia

    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 Files
  • amoursol
    Senior Member
    • November 21, 2012
    • 612
    • Boston, MA (USA)

    #2
    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 Files

    Sol Amour

    Architectural Explorer, Digital warrior, Affectual adventurer and Curious Human Being
    Portfolio Website @ Cargo Collective

    Comment

    • Mimi Azimar
      Junior Member
      • March 16, 2017
      • 16
      • Malaysia

      #3
      Dear Sol Amour,

      I dont get same result as yours.

      Anything wrong here?
      Attached Files

      Comment

      • amoursol
        Senior Member
        • November 21, 2012
        • 612
        • Boston, MA (USA)

        #4
        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 Files

        Sol Amour

        Architectural Explorer, Digital warrior, Affectual adventurer and Curious Human Being
        Portfolio Website @ Cargo Collective

        Comment

        • Mimi Azimar
          Junior Member
          • March 16, 2017
          • 16
          • Malaysia

          #5
          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 Files

          Comment

          • amoursol
            Senior Member
            • November 21, 2012
            • 612
            • Boston, MA (USA)

            #6
            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').

            Sol Amour

            Architectural Explorer, Digital warrior, Affectual adventurer and Curious Human Being
            Portfolio Website @ Cargo Collective

            Comment

            Related Topics

            Collapse

            • How to check an output is an element
              How to check whether a parameter value is an element where in C# we can use "if element is level". For example here parameter Top Constraint...
              April 20, 2017, 05:09 AM
            • Sort Views By Elevation of Associated Level
              Hi - I'm trying to get a list of plan views sorted by the elevation of their associated level. I've managed to obtain the associated level of a view...
              December 12, 2017, 09:15 PM
            • List Replace Items
              Hello all!

              I am trying to "combine" two lists into one cohesive list.

              In List 1, I have list items that are "empty"...
              November 30, 2015, 04:28 PM
            • Dynamo-like IndexMatch?
              The GoogleFu is weak with this one - and though sure this has been asked a million times before, I can't seem to find the solutions to my amateurish issue....
              October 22, 2017, 12:41 PM
            • Replace values in list, by list
              Im trying to replace a sequence in my view names: 1, 2, 3, 4, 5, 6.
              By A, B, C, D, E, F, G.

              See attached picture.

              The...
              March 17, 2020, 10:03 AM
            Working...