re-order list

Hi,

Maybe a very easy question,

I am trying to place circles from "elements in rage" method. When GC generate the list of the circle, it gives random sublists/the order they are drawn (Shown as Red Color text, eg. circle[0], circle[1], circle[2], circle [8].....circle[7]. Is there a way I can manipulate the list and give the number that I like for each circle? (Shown as White Color text, eg. circle[0], circle[1], circle[2], circle [3].....circle[8])

Thanks in Advance,

Jaimin Patel

Structural Drafter - WSP Australia

  • Hi Jaimin,

    What I tend to do is try and find a way to order them. 

    Typically this could be done by X, Y or Z direction. Not sure in your case as it appears it could be rotated.

    However you could try this:

    Place an expression node and paste in:

    from Crcl in circle1 orderby Crcl.CenterPoint.X

    Crcl is just a random variable name I gave it.

    You would need to replace circle1 with your circle node name

    This would return a list in ascending order as it moved in the X direction.

    If you then wanted to generate a new list of circles you could easily drop in a circle node by CopyTransformGeometricContents and just copy in place by inputting say baseCS in both the CopyFrom and CopyTo fields.

    Another options would be to merge both orderby and copytransform into a function but this is a good starting point if it works for you.

    Thanks

    Wayne

    sample file

    orderby.dgn

    Answer Verified By: Jaimin Patel 

  • Thanks Wayne,

    Almost the answer I wanted, it works pretty well, in addition to it one can use "MembersAt({a, b, c}) to rearrange the order, quite handy.

    Regards,

    Jaimin Patel

  • Hi Jaimin,

    Happy it got you on the way.

    MembersAt is a good option. A bit easier if you have a fixed list of items. (and a better approach than my suggested copytransform)

    The advantage of using a orderby is if you are referencing other geometry into you file and the order changes due to someone deleting something or add more, it will still order the list.

    or if you are feeling adventurous you could add both into a function!

    Thanks

    Wayne