I’m currently working on a whole new module for the foundation plugin and I am trying to implement a polyline stemwall rather than a polygon or rectangular stemwall (outline) which requires a closed loop.
The initial draw function is fairly simple, the user consecutively picks a bunch of points which then are passed from the tool to my main draw function and the stemwall is drawn, and the points are stored in an array within the attribute library for the assembly (group). I immediately know which is the first point, which is the last point and the points will naturally be in order.
The problem will arise when the user goes to edit this polyline. My intent is to have the plugin create the edges in a temp group via the stored points and then the user can simply edit the edges and then hit the submit button once they have moved, added or deleted the edges they choose to modify.
Once they hit the submit button I somehow have to extract the points from this group of interconnected edges. It’s really not too hard to grab all of the edges in the goup or even to check to make sure that they are connected using some logic and the all_connected method in the Edge class.
My bigger question is how to best determine which two points are the end points of the polyline and also how to get the points so they are in order. This becomes particularly important when I lay out anchor bolts and other features along each segment of this polyline. I also need to come up with some logic to check to see if the user created a closed loop rather than an open polyline (start point will equal end point?).
Strangely I have not come across this specific problem before, up until now it has been single edges or closed loops of edges that I’ve had to deal with.