=begin
Copyright 2013, Chris Fullmer
All Rights Reserved

Disclaimer
THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

License
This software is distributed under the Smustard End User License Agreement
http://www.smustard.com/eula

Information
Author - Chris Fullmer
Organization - www.ChrisFullmer.com and distributed on the SketchUp Extension Warehouse and smustard.com
Name - Loose Geometry to Groups
SU Version - 2013, 8, 7

Description
This script groups all loose geometry into multiple groups.

Usage
Run the script from Plugins > Chris Fullmer Tools > Loose Geometry to Groups.  If the user has 
geometry selected, it will work the selection.  If nothing is slected, it will work with all loose 
geometry.  It will not group components or existing groups.  It makes a new group for all connected 
geometry.  So if there are 20 separate boxes, it will make 20 separate groups - 1 for each box.  
I use this to quickly group large amounts of quickly made 3d buildings over bery large areas of land.  
This way I do not have so much loose geometry floating around.

History::
0.1:: 2009-02-07
   * First release
1.0:: 2009-02-13
   * Update rdoc compatiblity
   * New license info to conform to Smustards EULA
1.1:: 2009-03-09
   * Organizer.rb support. If you place this script into an organizer directory, it will appear in the correct submenu.  If its just in the plugins folder, it will appear in "Chris Fullmer Tools" submenu of the Plugins Menu."
1.2:: 2009-08-28
   * Fixed a major bug where the script was not working with selections.
   * Fixed some internal coding that might make it slightly faster.
   * Added an entity counter to the Status Bar so you can see the script working.
   * Changed the Undo title from "Make groups" to "Loose to Groups" (this is the title that you see in the Edit > Undo command).
1.3.0 2013-05-03
  * Made EW compliant
  * Wrapped into new modules
  * Updated menu system
1.3.1 2013-05-06
  * Fixed menu compatibility with older clf scripts  
=end


module CLF_Extensions_NS

  module Clf_Loose_To_Groups

    require 'sketchup.rb'
    require 'extensions.rb'
    
    NAME = "clf_loose_to_groups"
    UNAME = "Clf Loose to Groups"
    MENU_NAME = "Loose to Groups"
    version = "1.3.1"           #EDIT
    desc = "This plugin will create multiple groups from loose geometry."
    copy_year = "2013"
    author = "Chris Fullmer"
    
#------edit above--------------------------------------------------------------- 

    
    extension = SketchupExtension.new UNAME, NAME+"/"+NAME+"_menus.rb"

    #The name= method sets the name which appears for an extension inside the Extensions Manager dialog.
    extension.name = UNAME

    # The description= method sets the long description which appears beneath an extension inside the Extensions Manager dialog.
    extension.description = desc + "  Access it via Plugins > Chris Fullmer Tools > "+MENU_NAME

    # The version method sets the version which appears beneath an extension inside the Extensions Manager dialog.
    extension.version = version

    # Create an entry in the Extension list that loads a script called
    # stairTools.rb.
    extension.copyright = copy_year
     
    # The creator= method sets the creator string which appears beneath an extension inside the Extensions Manager dialog.
    extension.creator = author

    # The register_extension method is used to register an extension with SketchUp's extension manager (in SketchUp preferences).
    Sketchup.register_extension( extension, true )
    
  end
end  