sketchucation logo sketchucation
    • 登入
    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!
    ⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update

    [Plugin] Select component instances on right click

    已排程 已置頂 已鎖定 已移動 Plugins
    28 貼文 16 Posters 34.7k 瀏覽 16 Watching
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • TIGT 離線
      TIG Moderator
      最後由 編輯

      Take care making selection sets that span different contexts - you can Bugsplat it you try to manipulate them !
      To select instances of similar named definitions this will work

      n="match";m=Sketchup.active_model;s=m.selection;s.clear;m.definitions.each{|d|s.add d.instances if d.name=~/#{n}/}
      

      Change the string 'match' within the "" to the pattern match you want - I suggest that you read-up of pattern-matching - e.g. n="[Cc]at" finds all definitions like 'Cat', 'cat1', 'tomcat', whereas anchoring the pattern to the start/end like this n="^[Cc]at" only matches 'Cat and 'cat1', or n="m[Cc]at$" to only matches '#tomcat' and 'TomCat'...

      TIG

      1 條回覆 最後回覆 回覆 引用 0
      • A 離線
        Abdullah
        最後由 編輯

        It didn't work first, because there was a "$" in the string (it looked like "abc$match"), so took only the part after "$" (and it looked like "match")and it work well. Thank you very much.

        By the way, are there any "good" Sketchup Ruby Tutorials/Books for Beginners? I would really like to learn it.

        1 條回覆 最後回覆 回覆 引用 0
        • TIGT 離線
          TIG Moderator
          最後由 編輯

          @abdullah said:

          It didn't work first, because there was a "$" in the string (it looked like "abc$match"), so took only the part after "$" (and it looked like "match")and it work well. Thank you very much.
          By the way, are there any "good" Sketchup Ruby Tutorials/Books for Beginners? I would really like to learn it.
          Look for Automatic Sketchup - as a pdf or a to-buy hard-copy.
          There are also several other links in the "developers' forum"...
          If you place a $ at the very end it says the pattern ends there.
          If you want to search for a '$' inside the text escape it '$'; same with the '^' which marks the very beginning.
          Here's a short guide to pattern matching... http://www.tutorialspoint.com/ruby/ruby_regular_expressions.htm

          TIG

          1 條回覆 最後回覆 回覆 引用 0
          • J 離線
            John_C
            最後由 編輯

            That's great, thanks ... 😄

            1 條回覆 最後回覆 回覆 引用 0
            • F 離線
              fullyfledgeded
              最後由 編輯

              Hi, Is there any way of selecting component families even if they are in groups or nested within other components? The only way i can get it to work with this plugin is if i explode until all desired components are no longer grouped or component nested.

              1 條回覆 最後回覆 回覆 引用 0
              • F 離線
                fullyfledgeded
                最後由 編輯

                Thanks TIG and Abdullah for sorting out a that code 🎉 I was frantically, searching the forum for a solution that i missed this code.

                Alot of my component instances, have annoyingly renamed, with #1, #2 etc added to them, ultimately creating new component definitions, increasing file size 😠

                now that i can select multiple instances at once, I can replace them with one component definition.

                However I still don't why this is happening, other people have this problem too:

                http://sketchucation.com/forums/viewtopic.php?f=15&t=22523

                might start a new post to see if there is any more info

                cheers

                1 條回覆 最後回覆 回覆 引用 0
                • S 離線
                  smicha
                  最後由 編輯

                  Great plugin. Thanks

                  1 條回覆 最後回覆 回覆 引用 0
                  • S 離線
                    Sir
                    最後由 編輯

                    fantastic plugin. extremely useful.

                    thanks

                    1 條回覆 最後回覆 回覆 引用 0
                    • 1
                    • 2
                    • 2 / 2
                    • 第一個貼文
                      最後的貼文
                    Buy SketchPlus
                    Buy SUbD
                    Buy WrapR
                    Buy eBook
                    Buy Modelur
                    Buy Vertex Tools
                    Buy SketchCuisine
                    Buy FormFonts

                    Advertisement