davecon wrote: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)
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.
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
- Code: Select all
mod = Sketchup.active_model
ent = mod.entities
sel = mod.selection
if !sel.empty? && sel.first.curve
# d is initial length, i is the increment, and a is the direction vector
for v in vers
d += i
UI.messagebox "select a curve"
It 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.