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

    Selection Toys for Definition name?

    Scheduled Pinned Locked Moved Plugins
    5 Posts 3 Posters 497 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.
    • kyericK Offline
      kyeric
      last edited by

      Hello!

      I have tried a few searches on this forum...but I still can't find...what I'm lookin' for. Hopefully you all can point me in the right direction.

      So, another model has been constructed and exported as a 3DS file and then imported into SketchUp. The import is fairley clean, but I would like to have a quick way to select objects in the new SketchUp model for putting them on my standard layers.

      Is there a plugin like Selection Toys that allows you to select entities with a certain definition name? i.e. - I have many object called "Wall01, Wall02, Wall03..." is there a way of quickly selecting all of the items just called "Wall" to change to a particular layer?

      Thanks for any and all help.

      Cheers!


      1 Reply Last reply Reply Quote 0
      • jujuJ Offline
        juju
        last edited by

        Do you normally use Outliner for this?

        Save the Earth, it's the only planet with chocolate.

        1 Reply Last reply Reply Quote 0
        • TIGT Offline
          TIG Moderator
          last edited by

          You can use some simple 'one-liners' in the Ruby Console...
          I'll explain the parts, then assemble them into a single line you can copy/paste into the Ruby Console, editing the component name 'cn'...
          You need to manually make the layer and assign the selected component instances to it...
          That process could also be included if you like...

          cn="^Wall"

          the component-definition's name pattern.

          note that "Wall" selects just wall, "^Wall" selects all starting with Wall, "^[Ww]all" includes those starting with upper and lower-case W, "^Wall[0-9]" limits it to those named Wall + a number 0 to 9 [and anything following]. To end a pattern use a final $ - so "^Wall[0-9]$" would NOT then match "Wall01" !

          Edit this string to suit your needs...

          m=Sketchup.active_model
          ss=m.selection
          ss.clear
          as=m.active_entities
          cs=as.grep(Sketchup::ComponentInstance).find_all{|e|e.definition.name=~/#{cn}/}
          ss.add(cs)

          And in just one line:

          cn="^Wall";m=Sketchup.active_model;ss=m.selection;ss.clear;as=m.active_entities;cs=as.grep(Sketchup;;ComponentInstance).find_all{|e|e.definition.name=~/#{cn}/};ss.add(cs)
          

          TIG

          1 Reply Last reply Reply Quote 0
          • kyericK Offline
            kyeric
            last edited by

            juju: Nope. I usually only use Groups, Components that track to Layers. Outliner is still pretty unused in my workflow (for now).

            TIG: Thanks so much, man! I will try to get around to doing what you are suggesting a little later today and report back. I really appreciate the guidance!


            1 Reply Last reply Reply Quote 0
            • kyericK Offline
              kyeric
              last edited by

              Got it to work. Thanks, TIG! πŸ‘Š

              @tig said:

              You can use some simple 'one-liners' in the Ruby Console...
              I'll explain the parts, then assemble them into a single line you can copy/paste into the Ruby Console, editing the component name 'cn'...
              You need to manually make the layer and assign the selected component instances to it...
              That process could also be included if you like...

              cn="^Wall"

              the component-definition's name pattern.

              note that "Wall" selects just wall, "^Wall" selects all starting with Wall, "^[Ww]all" includes those starting with upper and lower-case W, "^Wall[0-9]" limits it to those named Wall + a number 0 to 9 [and anything following]. To end a pattern use a final $ - so "^Wall[0-9]$" would NOT then match "Wall01" !

              Edit this string to suit your needs...

              m=Sketchup.active_model
              ss=m.selection
              ss.clear
              as=m.active_entities
              cs=as.grep(Sketchup::ComponentInstance).find_all{|e|e.definition.name=~/#{cn}/}
              ss.add(cs)

              And in just one line:

              cn="^Wall";m=Sketchup.active_model;ss=m.selection;ss.clear;as=m.active_entities;cs=as.grep(Sketchup;;ComponentInstance).find_all{|e|e.definition.name=~/#{cn}/};ss.add(cs)
              

              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