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!
    πŸ«› Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download

    Fast way to toggle visibility

    Scheduled Pinned Locked Moved Developers' Forum
    6 Posts 3 Posters 385 Views 3 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.
    • N Offline
      NewGuy
      last edited by

      I am looking for the fast possible way to toggle the visibility of a lot of individual groups or components. I am currently using Set (selection sets) to remember what objects need to be turned on and off, but it is still a little slow when I use the script below on a 100+ groups:

      $set.each { | item | item.visible = true }

      Any way to speed this process up? Or is this the only way?

      Thanks,
      NewGuy

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

        Assign them a Layer and toggle the Layer?

        Hi

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

          Are you using it within a model.start_operation with the second argument to true? (disable UI?)

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

          1 Reply Last reply Reply Quote 0
          • N Offline
            NewGuy
            last edited by

            "model.start_operation"

            That was it! Layers was my plan B. Thanks for the quick response.

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

              Note that using the second argument only works with SU7+

              I use this proxy method:

              
                def self.start_operation(name)
                  model = Sketchup.active_model
                  if Sketchup.version.split('.')[0].to_i >= 7
                    model.start_operation(name, true)
                  else
                    model.start_operation(name)
                  end
                end
              
              

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

              1 Reply Last reply Reply Quote 0
              • N Offline
                NewGuy
                last edited by

                Good point.

                Thanks

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                • First post
                  Last post
                Buy SketchPlus
                Buy SUbD
                Buy WrapR
                Buy eBook
                Buy Modelur
                Buy Vertex Tools
                Buy SketchCuisine
                Buy FormFonts

                Advertisement