Here is your code how I tweaked it. I think all I did was move the if @thing == 0 to the bottom and then changed all the sets back to arrays and then made the @vert array uniq!. SO look this over and compare it to yours. See if that helps.
require "sketchup.rb"
class Pinchmover
def activate
@model = Sketchup.active_model
@ent = @model.entities
@view = @model.active_view
@slct = @model.selection
@slct.clear
@vect = []
@verts = []
@dvert = []
@thing = 0
end
def onLButtonUp(flags, x, y, view)
if @thing == 1
vec=[]
ip2 = view.inputpoint x,y
pt3 = ip2.position
pt4 = Geom;;Point3d.new pt3
@cpoint2 = @ent.add_cpoint pt4
prompts = ["Radius="]
defaults = [ 0.0.to_l]
list = [""]
results = UI.inputbox prompts, defaults, list, "Please input desired radius."
@rad= results[0].to_l
@ent.each do |e|
if e.typename == "Edge"
@verts << e.start
@verts << e.end
end
end
@verts.uniq!
@verts.each do |v|
dist = v.position.distance @cpoint.position
if dist < @rad
@dvert << v
end
end
@dvert.each do |d| # Doesn't seem to work.
vec = @cpoint.position.vector_to @cpoint2.position
@vect << vec
end
Sketchup.active_model.entities.transform_by_vectors @dvert, @vect
@thing = 2
end
if @thing == 0
ip1 = view.inputpoint x,y
pt1 = ip1.position
pt2 = Geom;;Point3d.new pt1
@cpoint = @ent.add_cpoint pt2
@thing = 1
end
end
end
Sketchup.active_model.select_tool Pinchmover.new
Chris