class WCO_ADDCICLEPOINT
  def WCO_ADDCICLEPOINT::start
    sel = Sketchup.active_model.selection
    ptss = []

    sel.each {|entity|
      if entity.class == Sketchup::Edge

      curve = entity.curve
        if curve.class == Sketchup::ArcCurve
        po =  curve.center
        x= po.x
        y= po.y
        z= po.z
        print x.to_s + ','+ y.to_s + ',' + z.to_s + "\n"
        ptss.push( po )
        end
      end
    }

#    Sketchup.active_model.active_entities.add_cpoint(curve.center)
    temp = []
    0.upto(ptss.length-1) do |i|
        x= ptss[i].x
        y= ptss[i].y
        z= ptss[i].z
    if temp.include?(x.to_s + ','+ y.to_s + ',' + z.to_s)

    else
        Sketchup.active_model.active_entities.add_cpoint ptss[i]
        print x.to_s + ','+ y.to_s + ',' + z.to_s + "----\n"
        temp.push(x.to_s + ','+ y.to_s + ',' + z.to_s)
    end


    end
    Sketchup.active_model.commit_operation


  end #def
end #class

toolbar = UI::Toolbar.new "WCO-Toolbar"

cmd = UI::Command.new("Add Curve-Centerpoint...") {
  WCO_ADDCICLEPOINT.start
}
cmd.small_icon = "WCO_ADDCICLEPOINT/addciclepoint_icon.png"
cmd.large_icon = "WCO_ADDCICLEPOINT/addciclepoint_icon.png"
cmd.tooltip = "Add Curve-Centerpoint"
cmd.status_bar_text = "Add Curve-Centerpoint"
cmd.menu_text = "Add Curve-Centerpoint"
toolbar.add_item cmd