How to force ruby to interact with selected edges in order of creation?

Hey here is a guide on how to properly post code in the forum:

Your Code:

model = Sketchup.active_model
selection = model.selection
y=0
p_arr = Array.new(100)
selection.each { |entity|
if entity.is_a?(Sketchup::Edge)
vertex = entity.end
p_arr[y] = vertex.position
y+=1
puts vertex.position
model.entities.add_line [0,0,0], vertex.position
UI.messagebox “P”
end
}
puts y.to_s

Sorry I have no other advice, perhaps someone with more knowledge than I can help…

1 Like