• Login
sketchucation logo sketchucation
  • Login
๐Ÿค‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

Selecting only Lock Groups

Scheduled Pinned Locked Moved Developers' Forum
6 Posts 3 Posters 516 Views
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.
  • K Offline
    ken
    last edited by 5 May 2008, 21:04

    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 5 May 2008, 21:41

      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
      • K Offline
        ken
        last edited by 6 May 2008, 10:38

        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 6 May 2008, 13:55

          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

          Link Preview Image
          Plugin: WebConsole

          2010-05-22 * Eliminated the Results textarea in favor of SketchUp's Ruby Console. * Automatic resize of the code textarea. * Changed ...

          favicon

          (sketchuptips.blogspot.com)

          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 6 May 2008, 14:40

            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 6 May 2008, 15:10

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

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

              Advertisement