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

    [Plugin] Groups to Components

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

      Overview
      By request; bulk conversion of groups to components. The Group's name is transferred to the component's definition's name.

      If anything selected, it processes only the selection, else it processes the current context.

      Access
      Plugins -> Groups to Components
      (Supports ThomThom's Menu)

      Link Preview Image
      SketchUp Plugins | PluginStore | SketchUcation

      SketchUp Plugin and Extension Store by SketchUcation provides free downloads of hundreds of SketchUp extensions and plugins

      favicon

      (sketchucation.com)

      Thomas Thomassen — SketchUp Monkey & Coding addict
      List of my plugins and link to the CookieWare fund

      1 條回覆 最後回覆 回覆 引用 0
      • CadFatherC 離線
        CadFather
        最後由 編輯

        Thanks Thom - i take it if there are multiple instances of a group, we'll get one component definition too (a la select toys)

        how about mining into nested groups?

        1 條回覆 最後回覆 回覆 引用 0
        • thomthomT 離線
          thomthom
          最後由 編輯

          @cadfather said:

          Thanks Thom - i take it if there are multiple instances of a group, we'll get one component definition too (a la select toys)

          No - it doesn't. This was quickly produced according to some specific requirement in time of a deadline. It's very basic.
          But I can update it to take into account multiple group-instances.

          Thomas Thomassen — SketchUp Monkey & Coding addict
          List of my plugins and link to the CookieWare fund

          1 條回覆 最後回覆 回覆 引用 0
          • CadFatherC 離線
            CadFather
            最後由 編輯

            That would be great

            1 條回覆 最後回覆 回覆 引用 0
            • thomthomT 離線
              thomthom
              最後由 編輯

              There is a logic issue here:
              This plugin works in a selection or current context scope. Group instances can exist across this scope.
              What is expected to happen to group instances outside the scope?

              Thomas Thomassen — SketchUp Monkey & Coding addict
              List of my plugins and link to the CookieWare fund

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

                You use model.definitions to get all of the group.instances [?] and then swap them out for the new component's definition, even if they are outside of the active_entities...

                Just as you could if you were swapping all definition1.instances for definition2 with
                definition1.instances.each{|ins|ins.definition=definition2} - which ignores 'context' ❓

                TIG

                1 條回覆 最後回覆 回覆 引用 0
                • thomthomT 離線
                  thomthom
                  最後由 編輯

                  That's the thing - ignore the working context or not... ?

                  Thomas Thomassen — SketchUp Monkey & Coding addict
                  List of my plugins and link to the CookieWare fund

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

                    IF you are to replace all instances of a group with a component surely you'd [usually] should do it across the whole model.
                    Perhaps if there are 'other-context' instances of a group [which is easily checked by getting all instances and comparing their parents against the current context parent ?] then a simple dialog along the lines of "There are Instances of Group 'xxx' outside 'active_entities'\n Make a Component of these too ?" Yes/No - which would allow the user to choose to leave some unfixed or fix all........... ❓

                    TIG

                    1 條回覆 最後回覆 回覆 引用 0
                    • thomthomT 離線
                      thomthom
                      最後由 編輯

                      I'm wondering if this isn't a feature fit for this plugin after all.

                      Thomas Thomassen — SketchUp Monkey & Coding addict
                      List of my plugins and link to the CookieWare fund

                      1 條回覆 最後回覆 回覆 引用 0
                      • M 離線
                        mac1
                        最後由 編輯

                        There is a plug in Make_components by Matt66 I think is the author. It will change groups to single or one overall. Is there any diff here??

                        1 條回覆 最後回覆 回覆 引用 0
                        • thomthomT 離線
                          thomthom
                          最後由 編輯

                          @mac1 said:

                          There is a plug in Make_components by Matt66 I think is the author. It will change groups to single or one overall. Is there any diff here??

                          http://forums.sketchucation.com/viewtopic.php?t=17590

                          @matt666 said:

                          • Make a group of just one entity (right click or menu plugins/Make group)
                          • Make a component instance of just one entity (right click or menu plugins/Make component)
                          • Convert each entity in the selection in a single group (right click or menu plugins/Convert on single groups)
                          • Convert each entity in the selection in a single component (right click or menu plugins/Convert on single components)
                          • Convert the selected component into a group (right click or menu plugins/Make group)

                          I don't see any Group -> Component feature there... no?

                          Thomas Thomassen — SketchUp Monkey & Coding addict
                          List of my plugins and link to the CookieWare fund

                          1 條回覆 最後回覆 回覆 引用 0
                          • thomthomT 離線
                            thomthom
                            最後由 編輯

                            Might be partly duplicate functions - but a key feature in this script was the naming: the definition inherited the group's name, not the instance.

                            @mac1 said:

                            I use it very often to convert single groups to components especially in models where some one has used a number of identical groups.

                            Does SketchUp still consider them copies of each other? If you select one and open Entity Info - does it say "Group (3 in model)" ?
                            If so, Selection Toys can convert them into components in one operation.

                            Thomas Thomassen — SketchUp Monkey & Coding addict
                            List of my plugins and link to the CookieWare fund

                            1 條回覆 最後回覆 回覆 引用 0
                            • M 離線
                              mac1
                              最後由 編輯

                              I use it very often to convert single groups to components especially in models where some one has used a number of identical groups. Then you can use the component browser function of replace selected to replace all these converted groups with one component. Caution there is a quirk with the program. You also have to include in your selection a line also. http://forums.sketchucation.com/viewtopic.php?f=323&t=28395

                              1 條回覆 最後回覆 回覆 引用 0
                              • M 離線
                                mac1
                                最後由 編輯

                                @thomthom said:

                                Might be partly duplicate functions - but a key feature in this script was the naming: the definition inherited the group's name, not the instance.

                                @mac1 said:

                                I use it very often to convert single groups to components especially in models where some one has used a number of identical groups.

                                Does SketchUp still consider them copies of each other? If you select one and open Entity Info - does it say "Group (3 in model)" ?
                                If so, Selection Toys can convert them into components in one operation.

                                Don't remember but you can take say 50 groups and then convert them to a single component or individual components (50) If my memory is correct it did use the same name for the component as the group number but what I don't like is how it moves around in the outliner and in a large model you have to then search to find the ones converted to replace as noted above

                                1 條回覆 最後回覆 回覆 引用 0
                                • M 離線
                                  mac1
                                  最後由 編輯

                                  Here is a good test case for you if you want to go crazy. http://www.google.com/support/forum/p/sketchup/thread?tid=0a9b7b20ecc8e1bf&hl=en The model uses a number of identical groups and those should be reduced to a single definition

                                  1 條回覆 最後回覆 回覆 引用 0
                                  • thomthomT 離線
                                    thomthom
                                    最後由 編輯

                                    I did not see any model to download... where about in the thread is it?

                                    Thomas Thomassen — SketchUp Monkey & Coding addict
                                    List of my plugins and link to the CookieWare fund

                                    1 條回覆 最後回覆 回覆 引用 0
                                    • M 離線
                                      mac1
                                      最後由 編輯

                                      @thomthom said:

                                      I did not see any model to download... where about in the thread is it?

                                      https://docs.google.com/leaf?id=0B37CGPyQd3oiMWE1NDJlMWEtYTdmMC00MzYwLWIzMzMtYTAwMGE3NjM2NTRh&hl=en_GB

                                      1 條回覆 最後回覆 回覆 引用 0
                                      • D 離線
                                        DIEGO-RODRIGUEZ
                                        最後由 編輯

                                        thom hello.
                                        thanks for the new plugins.
                                        a question:
                                        what is the difference with the "Group copies> Convert Into components" of your plugins SELECTION TOY 2.0.

                                        1 條回覆 最後回覆 回覆 引用 0
                                        • thomthomT 離線
                                          thomthom
                                          最後由 編輯

                                          @diego-rodriguez said:

                                          thom hello.
                                          thanks for the new plugins.
                                          a question:
                                          what is the difference with the "Group copies> Convert Into components" of your plugins SELECTION TOY 2.0.

                                          This one converts each group instance into a component instance. (plus it transfers the name to the definition)

                                          Selection Toys will convert all instances of a group into instances of one component definition.

                                          Thomas Thomassen — SketchUp Monkey & Coding addict
                                          List of my plugins and link to the CookieWare fund

                                          1 條回覆 最後回覆 回覆 引用 0
                                          • CadFatherC 離線
                                            CadFather
                                            最後由 編輯

                                            Matts plugin is still buggy, he has been very busy and not able to update many of his scripts - on the other hand Fredo's scale tools include a group to component command, so Thom you don't really need the extra effort for this plugin - but perhaps a CTRL toggle between the wider context and not could be handy... 💚

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

                                            Advertisement