@davecon said:
Thanks for the help so far everyone π
I have got the hang of doing this on a straight line, now the complex bit is trying to do it on a spiral. Currently I am trying to turn the model on the left (spiral with even length lines) in the model on the right (spiral with lines increasing by XX per length)
[attachment=1:2ramdbm4]<!-- ia1 -->spiral lines.jpg<!-- ia1 -->[/attachment:2ramdbm4]Ideally what I would like to be able to do is select the first line (red) and then the last line (green) and be able to input something like "starting the with the first line make all the others increase in XXmm increments"
Here is the file itself so far.
[attachment=0:2ramdbm4]<!-- ia0 -->spiral lines.skp<!-- ia0 -->[/attachment:2ramdbm4]
Instead of going to the trouble of creating the equal length lines then extending them incrementally, I would make the "baseline", be it a flat spiral or a straight line divided into the desired number of segments, into a curve using weld and then you can create the lines originating from the curve's vertices.
The code to do this is as simple as this
mod = Sketchup.active_model ent = mod.entities sel = mod.selection if !sel.empty? && sel.first.curve vers=sel.first.curve.vertices # d is initial length, i is the increment, and a is the direction vector d=875.0.mm;i=87.5.mm;a=[0,0,-1] for v in vers p=v.position;pp=p.offset(a,d) ent.add_line(p,pp) d += i end else UI.messagebox "select a curve" endIt would be a monumental task to try to figure out the order of the equal length lines. When you select a group of anything, there is no guaranty that Sketchup will add them to the selection in the proper order. At least that has been my experience.