### 20140222 TIG reworked...
### works from active_context downwards, if in model ALL are Unhidden.
require 'sketchup.rb'
###
module TIG
	module Unhide_All_Entities
		###
		unless file_loaded?(__FILE__)
			UI.menu("Plugins").add_item("Unhide All Entities") { self.start( Sketchup.active_model.active_entities ) }
		end
		file_loaded(__FILE__)
		###
		def self.start(entities=[])
			model=Sketchup.active_model
			model.start_operation("Unhide All Entities")
				self.unhide(entities)
			model.commit_operation
		end
		###
		def self.unhide(entities=[])
			entities.each{|e|
				e.hidden = false if e.hidden?
				self.unhide( e.entities ) if e.is_a?(Sketchup::Group)
				self.unhide( e.definition.entities ) if e.is_a?(Sketchup::ComponentInstance)
			}
		end
		###
	end#module
end#module
