I am trying to organize wall data into lists of lists based on x and y coordinates and I am struggling to even logically think about a way to perform the following operation. Any help would be appreciated.
Essentially, the end product I want is an organized list of wall data, that, if the start and end points of a wall are within some given tolerance (say +/- 0.5 feet), they will say they are close enough and spit out a lists of lists that is organized based on elevation.
An example probably more clearly illustrates my goals:
In the picture shown above, list 3 and list 4 are seperated because the program has recoginized that the end location of the wall x and y coordinates is greater than the given tolerance.
Thoughts on how to solve this are as follows:
Write some python code that sees how many unique sets of unique x and y coordinates there are, this sets how many main lists I have (.
Based on these unique set of x and y coordinates, find all walls with that x and y coordinates. This creates an unorganized sublist with levels that could be jumbled
Sort sublists based on elevation data within sublist.
I am going to start digging into this with some python code, but wanted to get some feelers out there if this is the way that others would go about solving this.
Ok, part one is tough from what I have discovered .
Trying to code the base number of lists to populate is not easy. I have been able to sort start points and points by x and y coordinates, but trying to figure out a way to code this if (2) walls are concurrent is difficult.
Originally is was trying x starting point - x any other point etc. and comparing to some tolerances but now my train of thought has shifted.
I almost think I am going to break these walls down into the equation of a line:
y = mx + b
if m and b are within some tolerance, say lines are concurrent?
I will keep this thread updated. things that i will need to explore is if lines with +/- m can be handled etc.
I believe Springs has a group by distance node that you can use with the Element.GetLocation or something similar. That should let you group things that are within an x distance.
Ok thank Kenny, got that, now onto organizing data.
Essentially i have now organized my slope data (m) with corresponding wall identities and I want to do the same with my b data. I think using sort by key option is the node I want, but I am struggling to organize my b data to match that of the m data.
Alright, almost solved part 1 of the problem, I now have a known number of unique walls, but I need to know how many elements are associated with each unique wall.
I think I need to add some sort of counter variable in my python script to keep count of the quantity within each loop. I have also never wrtten data to variable before that has unknown size, @kennyb6 , do you know how you would handle this?
I am confused with what you are doing. You have a counter with the line count = count + 1. Are you trying to initialize a list called ‘value’ and then replace within the list at index a? Is the point of this to keep the same structure but with a new value? What should be inside ‘value’ when not filled with a?
I am just calling the first conditional the “if” statement and the second conditional the “else” statement.
I am away from my computer for the rest of the night, but I think I maybe see some potential problems that I will explore tomorrow.
First one, value needs to have a value if the first conditional is met, a value of 1
Second one being that the value at the count index will keep getting overwritten if the walls are stacking, I would think that python could handle this, more than likely I just have syntax wrong or something.