I have a problem with this code when I have minus values for the eastings it renames the type mark from right to left on screen not left to right. Please see below.
I did see it and I played around with but I can’t get it work. the translate just changes a position of a point, not how Dynamo sorts the family out from left to right on the screen.
Thanks for the link. I’ve tried to adapt that code and it runs without warnings but it doesn’t work, I think it’s because I false values in the first listmap. I’m using version 1.2 I don’t know if that makes a difference.
@James_Washbourne First group by X positions, then sort by Y positions within each grouping
Reverse lists to order them left to right and top to bottom Numbering.dyn (12.5 KB)
Thanks for this, but I’m still having the same problem as before, its renaming the values from right to left even with your code. I’ve adapted the the Dyn. to start with family types instead of family category and that’s all I’ve changed.
This is a live job and I’ve acquired co-ordinates from the Architect file. Could this be causing the issue?Would the position of the project base point be causing the problem?
I’ve tried to upload the Revit file but it too big, Is there any chance I can forward it to by Wetranfer or something.
Since all of your Families are beyond your Project Base Point, why not simply extract your eastings coordinate (i.e. Y of your PBP) abs() it, then add it to your bounding box y points list. This will make all values positive without changing relative distances, and now you can use it as the key list for List.SortByKeys.
This will work regardless. Only limitation would be if you have a Family Instance placed before the PBP as it would obviously still have a negative y value despite the addition. If you want it bullet proof, the solution here would be to join the PBP y value to your bounding box list of y values then find the minimum value and use that for the addition.
I’ve taken what you all said on board. What I think will solve it is having a family of some description in the bottom left hand corner, get it positions which is easy enough, then get some vectors values to the piles to find the relative x,y, co-ordinates form the base family and try and sort it that way.
This has work fine for the top row of piles but not the middle row. It might be lacing problem somewhere. what I’ve found in the second list.sortbykey node there’s the same family listed 3 times. See below. I’ve also attached the DYN.
Thanks for this it works beautifully. Do you think this will work in this manner regardless where the project base point is positioned or would it be an idea incorporate your code above with my one using vectors from a known point. I trying to get to a stage when I have a code that’s bombproof in all scenarios.