I’ve been tasked with setting out approximately 10k foundation piles. I have the coordindates sorted, however, the subscription tools only allow renumbering from survey origin. I have been asked to number the piles from where the contractor is starting to drive from.
I have also been asked to separate a portion of the building which is sequenced first.
This is the first time that I’ve done any programming, and looking through the clockworks package, I can see that something similar has been achieved. I have recreated the script, with the inclusion of some parameter filters (shared parameter for zone, shared parameter for foundation type).
The script selects the correct piles, however the listing function at the end is throwing up errors - any help on this would be greatly appreciated. At the moment, I’m using the unique element ID to number the piles, but the sequence isn’t logical for the schedules.
The error is in the sort list of lists function. The list created prior to this works fine. Due to the first “sort list of lists” failing (sorting the X value of the points), the second “sort list of lists” (sorting Y value of the points) cannot function.
The problem is not with the List.SortListOfLists node. The nested list you are passing into it does not have the expected format, because the first sublist only contains a single item (the result of your List.Count operation). It looks like the result you want to get is a list of sorted indices, so you would have to pass a list of indices into the first sublist. Have a look here how to do that: http://dynamobim.com/forums/topic/list-data-converting/
I fiddled with this and managed to get some form of definition going. I couldn’t quite understand your List.SortListofLists node, Andreas, but I couldn’t see that you used the “itemgetter” from the “operator” module? I think you can skip the double List.SortListofLists node if you use that.
The way my definition works now it is sorted one way or the diagonal opposite. I hope some other Python gurus can do better so one can sort it anyway possible! Element.SortByXYZ in Clockwork maybe?