sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Fast way to toggle visibility

    Scheduled Pinned Locked Moved Developers' Forum
    6 Posts 3 Posters 362 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