# copyright= 'Huynh Duong Phuong Vi @ 2013-2015'
# suforyou.vn@gmail.com
module S4U::S4u_Delete_Overlap
		Sketchup::require 'sketchup.rb'     
		Sketchup::require 'langhandler.rb'
		Sketchup::require File.join(NAME,(NAME + "_code"))
		if(not file_loaded?(__FILE__))  
			S4U.instance_variable_set(:@s4u_menu,UI.menu("Plugins").add_submenu("Suforyou")) if !S4U.instance_variable_defined?(:@s4u_menu)
			menu=S4U.instance_variable_get :@s4u_menu 
			toolbar = UI::Toolbar.new("s4u-"+Strings.GetString(TOOL))  
			names=[Strings.GetString(TOOL),"s4u_delete_overlap_large.png","s4u_delete_overlap_small.png",Strings.GetString("Delete all instances(or new Group) which is overlap its position(in Selection or all).Select objects first OR no selection to find All instances in model")]
			commands= UI::Command.new(names[0]){ self.main }
			commands.large_icon = names[1] 
			commands.small_icon = names[2]
			commands.status_bar_text = names[3] 
			commands.tooltip= names[0] 
			commands.menu_text = names[0] 
			toolbar = toolbar.add_item commands
			menu.add_item commands
			toolbar.show if toolbar.get_last_state.abs == 1
		end
end
