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!
    🔌 Easy Offset | Offset selected faces in SketchUp in positive and negative offsets. Download

    [Plugin] Component/group tools

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

      Hi all!
      Here is a set of tools to play with components and groups.
      It can :

      • 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)
        SU has a native tool to convert a group into a component.

      That's all!
      😉


      Make_Components.rb

      Frenglish at its best !
      My scripts

      1 條回覆 最後回覆 回覆 引用 0
      • pilouP 離線
        pilou
        最後由 編輯

        For study in deepth components groups 😄

        Frenchy Pilou
        Is beautiful that please without concept!
        My Little site :)

        1 條回覆 最後回覆 回覆 引用 0
        • MALAISEM 離線
          MALAISE
          最後由 編輯

          Useful, but carefully select entities

          Thanks Matt

          MALAISE

          La Connaissance n'a de valeur que partagée

          1 條回覆 最後回覆 回覆 引用 0
          • L 離線
            leixing
            最後由 編輯

            it does not work if i use the first and second item.
            the sketchup is dead!!
            please tell me why or make a example.
            thanks!

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

              Sorry for the delay!
              Aille... I tested it more deeper, and yes, SU crashes... Sorry. I don't know why.I will investigate.
              Thank you for the feedback!

              Frenglish at its best !
              My scripts

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

                Hi Matt,

                Your script make sense!
                and it reminds me an idea,
                I wish there will be a plugin:
                First we draw single lines, then we select a component,
                I hope the plugin can make each single straight line into a component, the length of the line will define the scale of the component.

                I don't know if it is possible, but I know it will also make big sense!

                Su30

                su30

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

                  Hi Matt - i think this script is great - hope you can find the crash fix sometime
                  Cheers..

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

                    Try this
                    http://www.sketchucation.com/forums/scf/viewtopic.php?p=145009#p145009

                    componentInstance.add_entities(entities,copy,unique)
                    

                    it might help you avoid the BugSplatting...

                    .

                    TIG

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

                      Hi Matt, hope you are so bored one of these days that you will pick this script up again!
                      cheers

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

                        Hi CadFather!
                        The problem is that working on components generates lots of problems... It's very hard for me.
                        I try sometimes, but slowly!

                        Frenglish at its best !
                        My scripts

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

                          ..take all the time you see fit Matt, i might post a request as well..cheers!

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

                            😉

                            Frenglish at its best !
                            My scripts

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

                              @matt666 said:

                              Hi all!
                              Here is a set of tools to play with components and groups.
                              It can :

                              • 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)
                                SU has a native tool to convert a group into a component.

                              That's all!
                              😉

                              * Edit post
                              * Report this post
                              * Reply with quote
                              

                              Make_Comonents.rb Version 1.1 Does Not Run All the Time

                              Postby mac1 on Tue May 18, 2010 10:30 am
                              System Windows xp sp3
                              SU as noted below
                              P4 3.2GHz Intel 865 PERL Mother Board, 4 GB Memory
                              I have been attempting to convert the file ref in this link http://www.google.com/support/forum/p/sketchup/thread?tid=50e8ceb670ed94ef&hl=en ( file: http://sketchup.google.com/3dwarehouse/details?mid=5841263f36529eef9f30f02514717f00 )to components but the script usually converts the first group and quits but, some times it will convert correctly. Ii have not been able to find the initial conditions to repeat the success case. When the failure occurs the ruby console reports this:
                              Error: #<NoMethodError: undefined method definition' for #<Deleted Entity:0x60ad9f0>> F:/PROGRA~1/Google/GOOGLE~1/Plugins/Make_Components.rb:140:in make_components'
                              F:/PROGRA~1/Google/GOOGLE~1/Plugins/Make_Components.rb:135:in each' F:/PROGRA~1/Google/GOOGLE~1/Plugins/Make_Components.rb:135:in make_components'
                              F:/PROGRA~1/Google/GOOGLE~1/Plugins/Make_Components.rb:48
                              F:/PROGRA~1/Google/GOOGLE~1/Plugins/Make_Components.rb:48:in `call'
                              I have uninstalled all ruby scripts except the ones loaded with the basic SU installation also removed SU 6. the failure repeats with both SU 7.0+ and SU 7.1 both with clean installs. I have tried a repair install with both SU 7's but cannot because of a missing msi file
                              Any Suggestions??

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

                                Update
                                Noted during my post the ruby console error report is different ( in the ref. help forum) that what was obtained in the last attempt to covert the groups. Line number ref are different by one and the entity octal number is different. Removed script, download from Matt's link above and reloaded with same result. 😞

                                1 條回覆 最後回覆 回覆 引用 0
                                • Chris FullmerC 離線
                                  Chris Fullmer
                                  最後由 編輯

                                  I looked over his code and there seems to be an error that pops up when you only have groups selected. Try running the script with always a non-group in the selection - like just draw a line and then select it along with the groups, then run the script. I think that will by pass the problems.

                                  Chris

                                  Lately you've been tan, suspicious for the winter.
                                  All my Plugins I've written

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

                                    @chris fullmer said:

                                    I looked over his code and there seems to be an error that pops up whn you only have groups selected. Try running the script wil always a non-group in the selection - like just draw a line and then select it along with the groups, then run the script. I think that will by pass the problems.

                                    Chris

                                    Thanks, nothing to it when you know what you are doing ☀
                                    BTW the line gets converted to component also ❓

                                    1 條回覆 最後回覆 回覆 引用 0
                                    • brookefoxB 離線
                                      brookefox
                                      最後由 編輯

                                      The utility of this script is beyond me. I will keep my head down in hopes that someone will post some uses.

                                      ~ Brooke

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

                                        @brookefox said:

                                        The utility of this script is beyond me. I will keep my head down in hopes that someone will post some uses.

                                        Very simple at least for me. A post in the Sketchup help forum having problems with file size had numerous groups with the same geo.( An example is shown in the ref test file I included with my post.) has a file size of ~930KB. If one converts to components, then uses the browser "replace selected" capability that goes down to around ~70KB. A significant reduction in my mind. If one looks at the model info stats report the edges and faces don't change that much. It was my feeble attempt to understand the imapct of max use of components which is often stated but not quantified. ❓ BTW I will on occasion place a very simple component in my model(s), have even used a line ( not a good idea), then recognizing a components definition is invariant under move, scale and rotation one can latter replace with a complex model which gets added to the model at the scale, location and rotation of the simple model( need to pay attention to your component axis)

                                        1 條回覆 最後回覆 回覆 引用 0
                                        • brookefoxB 離線
                                          brookefox
                                          最後由 編輯

                                          Thanks for yor response. This use I get but for it I don't need this plugin:
                                          @unknownuser said:

                                          problems with file size had numerous groups with the same geo.
                                          One can make components out of groups and instances of groups this with native SU.

                                          It's the making of components out of lines that I don't get much of.

                                          So for your 'simple' best use you would have a lot of lines in your models which are not parts of components, and making them components with this would reduce your file size. OK. I do have a lot of groups which are not components, but next to no lines which are not parts of groups or components. For me the crux is when and what groups to componetize, just because it take time, even if it saves file space. Certainly if I have many of said group or I want component behavior from a group it would be best componentized, I don't need a plugin to do that. Rereading the thread I see the use implied of maybe wanting to populate a model with lines, componetize them and then subsequently edit the component which would then be in place wherever the lines were. If I can do this now with two lines instead of one, that is sufficient for me.

                                          ~ Brooke

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

                                            @brookefox said:

                                            Thanks for yor response. This use I get but for it I don't need this plugin:
                                            @unknownuser said:

                                            problems with file size had numerous groups with the same geo.
                                            One can make components out of groups and instances of groups this with native SU.

                                            It's the making of components out of lines that I don't get much of.

                                            So for your 'simple' best use you would have a lot of lines in your models which are not parts of components, and making them components with this would reduce your file size. OK. I do have a lot of groups which are not components, but next to no lines which are not parts of groups or components. For me the crux is when and what groups to componetize, just because it take time, even if it saves file space. Certainly if I have many of said group or I want component behavior from a group it would be best componentized, I don't need a plugin to do that. Rereading the thread I see the use implied of maybe wanting to populate a model with lines, componetize them and then subsequently edit the component which would then be in place wherever the lines were. If I can do this now with two lines instead of one, that is sufficient for me.

                                            Glad you are happy with what you have that is what is important. The plugin is just another wrench in the tool box.
                                            You are correct SU has that native capability but what are you going to do if you have say a 100 groups and identical. The native tool will make a component out of all of them but the reduction of file size doing that will be nil.
                                            My test case was not suppose to be a global analysis of a model having a mix of various entities and was meant to show what poor modeling practice can cost one. The model has 33 groups and nested in each of those is three groups( all identical) and some other simple entities a really a simple model. If you examine one of those and expolde the component the change in file size is nil so the the message is use components but having a bunch of nested groups in the components does not help much
                                            Gday

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

                                            Advertisement