sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    Mac User? | Join the Rayscaper Beta for Mac Learn More

    Quick Selection

    Scheduled Pinned Locked Moved Plugins
    15 Posts 7 Posters 2.0k Views 7 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      paddyclown
      last edited by

      thankyou, that worked for me !

      1 Reply Last reply
      Reply Quote 0
      • P
        paddyclown
        last edited by

        Hi,

        All worked for a while in 2014, but in 2015 and last updated version 2014, I get this error when trying to use the quick selection tool...

        "Starting quick selection...
        Parsing objects with option: All visible objects
        Error: #<NameError: uninitialized constant Set>
        (eval):63:in build_searchable_entities' (eval):495:in quick_selection'
        (eval):691:in qs' (eval):710:in block in <top (required)>'
        -e:1:in `call'"

        any ideas please ?

        1 Reply Last reply
        Reply Quote 0
        • D
          driven
          last edited by

          @paddyclown said:

          Error: #<NameError: uninitialized constant Set>

          Sketchup removed Set it now users Sketchup::Set

          you could add

          require('set')
          

          at the top of the script...

          it may then work, otherwise it needs a proper fix...
          john

          learn from the mistakes of others, you may not live long enough to make them all yourself...

          1 Reply Last reply
          Reply Quote 0
          • P
            paddyclown
            last edited by

            John, Thanks for the idea... it just made SU bugsplat on start... so i undid the change in order to work; I guess we just have to hope D Bur has a moment to update this plugin which was brilliant !

            1 Reply Last reply
            Reply Quote 0
            • J
              Jim
              last edited by

              You can replace all occurrences in the script from Set.new with Sketchup::Set.new

              Hi

              1 Reply Last reply
              Reply Quote 0
              • P
                paddyclown
                last edited by

                Jim,
                Thankyou ! BingoBongo it works !
                best,

                1 Reply Last reply
                Reply Quote 0
                • J
                  Jim
                  last edited by

                  @driven said:

                  would it not be better to do a search and replace changing Set to Sketchup::Set in the script...

                  Yes.

                  I edited my example to remove the code snippet - it's a very bad idea.

                  Hi

                  1 Reply Last reply
                  Reply Quote 0
                  • thomthomT
                    thomthom
                    last edited by

                    @driven said:

                    @jim said:

                    This should work.

                    
                    > > if defined?(Sketchup;;Set)
                    > >   Set = Sketchup;;Set
                    > > end
                    > > 
                    

                    I was going to suggest that, but what happens if another ruby has already used require 'set'?

                    would it not be better to do a search and replace changing Set to Sketchup::Set in the script...
                    john

                    That shim should be done in the extension namespace - then it's all fine. It should NOT be done in the global namespace as that will clash.

                    Thomas Thomassen β€” SketchUp Monkey & Coding addict
                    List of my plugins and link to the CookieWare fund

                    1 Reply Last reply
                    Reply Quote 0
                    • J
                      Jim
                      last edited by

                      I edited my snippet - it was a bad example without the namespace.

                      Better to just find and replace Set.new with Sketchup::Set.new

                      Hi

                      1 Reply Last reply
                      Reply Quote 0
                      • D
                        driven
                        last edited by

                        @jim said:

                        This should work.

                        
                        > Edit; removed Jim's example
                        > 
                        

                        I was going to suggest that, but what happens if another ruby has already used require 'set'?

                        would it not be better to do a search and replace changing Set to Sketchup::Set in the script...
                        john

                        learn from the mistakes of others, you may not live long enough to make them all yourself...

                        1 Reply Last reply
                        Reply Quote 0
                        • Dan RathbunD
                          Dan Rathbun
                          last edited by Dan Rathbun

                          The easiest fix for Ruby 2 and higher, is to use a refinement that only that file can "see" and use.
                          I inserted the following at the top of the file (after deleting the Set reassignment):

                          require 'set'
                          
                          # Create a refinement for the Set class:
                          module DBUR
                            module RefinedSet
                              refine ::Set do
                                alias :insert :add
                                alias :contains? :include?
                              end
                            end
                          end
                          
                          # Use the refinement:
                          using DBUR::RefinedSet
                          

                          By request from @paddyclown, here is the "fixed" file.
                          It still needs a drastic overhaul, but this will get it working (fingers crossed):

                          DBUR_QuickSelection.rb

                          @Didier-Bur ping (I do not know how to send this by PM in this new forum interface.)

                          I'm not here much anymore.

                          1 Reply Last reply
                          Reply Quote 1

                          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                          With your input, this post could be even better πŸ’—

                          Register Login
                          • 1 / 1
                          • First post
                            Last post
                          Buy SketchPlus
                          Buy SUbD
                          Buy WrapR
                          Buy eBook
                          Buy Modelur
                          Buy Vertex Tools
                          Buy SketchCuisine
                          Buy FormFonts

                          Advertisement