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

    Selecting only Lock Groups

    Scheduled Pinned Locked Moved Developers' Forum
    6 Posts 3 Posters 516 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.
    • kenK Offline
      ken
      last edited by

      Is it possible to select only locked groups, so I could separate the locked from the unlocked?

      Ken, thanks in advance

      Fight like your the third monkey on Noah's Ark gangway.

      1 Reply Last reply Reply Quote 0
      • T Offline
        todd burch
        last edited by

        Sure. Just query the component.locked? or group.locked? methods.

        FYI - there is a current bug that allows a locked group or comp to be moved by Ruby (unless it's been fixed by a recent maintenance release that I've chosen to ignore).

        1 Reply Last reply Reply Quote 0
        • kenK Offline
          ken
          last edited by

          Thanks Todd for your response. Guess I put my question in the wrong group. I was wondering if there was a Ruby Script to just select locked groups or components.

          Guess there isn't as of now.

          Again thanks.

          Ken

          Fight like your the third monkey on Noah's Ark gangway.

          1 Reply Last reply Reply Quote 0
          • A Offline
            a4chitect
            last edited by

            Sketchup.active_model.active_entities.each{|ent|
            if(ent.typename=="Group" && ent.locked?)
            Sketchup.active_model.selection.add ent
            end
            }
            

            paste the above into a ruby console (I suggest using Jim's Webconsole) and Execute

            http://sketchuptips.blogspot.com/2007/08/plugin-webconsolerb.html

            warning: no testing for errors or bugs, use at your own risk

            1 Reply Last reply Reply Quote 0
            • T Offline
              todd burch
              last edited by

              I can code that in one statement.... πŸ‘Š

              
              Sketchup.active_model.selection.add((Sketchup.active_model.entities.collect {|ent| ent if ent.locked?}).to_a.compact)
              
              

              πŸ€“

              Todd

              1 Reply Last reply Reply Quote 0
              • A Offline
                a4chitect
                last edited by

                all right, respect. there you go webconsole πŸ˜‰

                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