Thanks a lot Antoine, I will look into this. And also see if I can get it to follow my ruleset. I was not really looking for a complete solution, since I really want to learn something here. But I guess its good to look at others scripts too, especially if you’re stuck like I am at the moment.
Maybe I should just explain what I’m trying to achieve as a whole.
I have some standard noise barrier elements that im placing along a curve - could be road geometry offset curve - the elements are composed of 3m and 5m segments, but if there is crossing pipes/wires in the ground I need to have 1m tolerance between my columns and the pipe (edge to edge). The noise barrier will always start out with a section1 composed as 3x3m segments (fixed rule) and then continues with a larger section2 composed of mainly 5m segments - until it hits a pipe/wire tolerance issue, then it should take a step backwards and insert a 3m segment and then continue with 5m segments. In the end I will have to figure something out too, since the curve will of course not fit with the 3 and 5m division and the last section3 will be 9m and should also be composed of 3x3m segments, just as the beginning. The overall length is not completely fixed (can be ±1 to 2m, I guess), since it is the configuration of modules that determines the total noise barrier length, but I would like to take that tolerance in the middle section where it should either subtract a 5m segment and replace with a 3m if it becomes too long, or just remove the last segment in section2.
The output is basically just insertion points and a polyline that follow the ruleset.
If it doesnt make sense I apologize. I have also added my “static” script, maybe that makes sense, eventhough its pretty messy and WIP. Again I want to note that I am trying to learn as much as possible so I’m not necessarily looking for a full solution, but pointers to material or similar solutions would be nice, thanks a bunch for the help so far
NB Alignment sub division - GH forum.gh