sketchucation logo sketchucation
    • Login
    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!
    Mac User? | Join the Rayscaper Beta for Mac Learn More

    [Plugin] Center of Gravity

    Scheduled Pinned Locked Moved Plugins
    183 Posts 41 Posters 336.3k Views 41 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.
    • TIGT
      TIG Moderator
      last edited by

      driven

      Have you got the recent v1.3, with the require 'deBabelizer.rb' added ?
      This should fix it ?

      TIG

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

        If calculate is a reserved term in Mac Ruby versus PC I'm surprised...
        You can edit the file and change every ' calculate' to say ' do_calculation' and see if that helps - if so let me know asap πŸ˜• πŸ˜• πŸ˜•

        TIG

        1 Reply Last reply
        Reply Quote 0
        • D
          driven
          last edited by

          Yes it's v1.3

          changed to tig_calculate (lines 131, 815)

          Error; #<NoMethodError; undefined method `db' for CofGravity;Class>
          /Library/Application Support/Google SketchUp 7/SketchUp/Plugins/CofGravity.rb;155;in `calculate'
          /Library/Application Support/Google SketchUp 7/SketchUp/Plugins/CofGravity.rb;815
          

          but the colour changed

          learn from the mistakes of others, you may not live long enough to make them all yourself...

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

            @driven said:

            Yes it's v1.3
            changed to tig_calculate (lines 131, 815)

            Error; #<NoMethodError; undefined method `db' for CofGravity;Class>
            > /Library/Application Support/Google SketchUp 7/SketchUp/Plugins/CofGravity.rb;155;in `calculate'
            > /Library/Application Support/Google SketchUp 7/SketchUp/Plugins/CofGravity.rb;815
            

            You mustn't have changed them all as it's still calling 'calculate' ?
            I've redone the original and v1.4 with full 'do_calculation' will be there asap...

            TIG

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

              Here's v1.4 http://forums.sketchucation.com/viewtopic.php?p=229401#p229401 with 'calculate' replaced with 'do_calculation' to see if that fixes it - if not I have exhausted all ideas so far !!!

              TIG

              1 Reply Last reply
              Reply Quote 0
              • D
                driven
                last edited by

                Ok, v1.4

                Error; #<NoMethodError; undefined method `db' for CofGravity;Class>
                /Library/Application Support/Google SketchUp 7/SketchUp/Plugins/CofGravity.rb;156;in `do_calculation'
                /Library/Application Support/Google SketchUp 7/SketchUp/Plugins/CofGravity.rb;816
                
                

                sorry

                learn from the mistakes of others, you may not live long enough to make them all yourself...

                1 Reply Last reply
                Reply Quote 0
                • GaieusG
                  Gaieus
                  last edited by

                  @tig said:

                  ...Any more ideas welcome... πŸ˜•

                  Not yet, TIG - at least not anything that would be clear. I was just thinking aloud and combining my ideas. Maybe when I have already used the plugin for such things.

                  Thanks anyway!
                  πŸ˜‰

                  Gai...

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

                    Aaaarrrgh... πŸ˜’
                    BUT as we can all see it is defining db as a method inside the particular class::def and then using it - the way it's used loads of times in other tools too... It works fine on PC so what is so special about a Mac ?
                    Puzzled... Any Mac scripters have any ideas ??? ❓ ❓ ❓

                    TIG

                    1 Reply Last reply
                    Reply Quote 0
                    • D
                      driven
                      last edited by

                      it is in the db method,

                      I just ran composite on to groups and got this

                      Error; #<NoMethodError; undefined method `db' for CofGravity;Class>
                      /Library/Application Support/Google SketchUp 7/SketchUp/Plugins/CofGravity.rb;604;in `composite'
                      /Library/Application Support/Google SketchUp 7/SketchUp/Plugins/CofGravity.rb;817
                      
                      

                      learn from the mistakes of others, you may not live long enough to make them all yourself...

                      1 Reply Last reply
                      Reply Quote 0
                      • C
                        chrisjk
                        last edited by

                        TIG,

                        Sorry for the earlier abbreviated message - I got called away from the computer.

                        I get the following when trying CofG (Version 1.4 here).

                        QUOTE

                        Error: #<NoMethodError: undefined method db' for CofGravity:Class> /Library/Application Support/Google SketchUp 7/SketchUp/Plugins/CofGravity.rb:156:in do_calculation'
                        /Library/Application Support/Google SketchUp 7/SketchUp/Plugins/CofGravity.rb:816

                        UNQUOTE

                        Chris

                        1 Reply Last reply
                        Reply Quote 0
                        • C
                          chrisjk
                          last edited by

                          Possibly something to do with the version of Ruby? Macs running Snow Leopard come with a pre-packaged version 1.8.7 of Ruby.

                          Chris

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

                            The error is with the db def method... BUT it ha been and is still working fine on PCs and it's been used in similar ways in many other tools... so why the problem here ?
                            To avoid having to add deBabelizer(string, lingvo_file_path) to every string in the output that needs translating I make a shortcut method def db for each tool
                            that alls deBabelizer and has the lingvo_file_path hardcoded into it, and works simply as db(string).
                            It's easy and effective in all my recent tools, so why the problem here ???
                            It's clear now that it wasn't the missed out 'require' or other possible clashes that were causing this... BUT why it's not working is a mystery... 😒 😳 ❓ πŸŽ‰

                            Surely you can call a def inside another def though ??? even with 1.8.7 on Macs ???

                            TIG

                            1 Reply Last reply
                            Reply Quote 0
                            • D
                              DSG2k
                              last edited by

                              I had checked for any evidence of Vista stupidity given past experience with having to look at the Virtual Store. But I've tried v. 1.4 and it works great!

                              Thank you so much for your incredible plugins. I'm using them for sci-fi mesh analysis and they are invaluable.

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

                                Seems to work fine on PC but on Mac it falls over... I WILL find a solution... πŸ˜’

                                TIG

                                1 Reply Last reply
                                Reply Quote 0
                                • D
                                  driven
                                  last edited by

                                  I'll try it on an sterile Mac i.e. just on it's own, see what happens, give me five minutes

                                  learn from the mistakes of others, you may not live long enough to make them all yourself...

                                  1 Reply Last reply
                                  Reply Quote 0
                                  • D
                                    driven
                                    last edited by

                                    Same error when v1.4 + debabelizer are the only rubies installed

                                    learn from the mistakes of others, you may not live long enough to make them all yourself...

                                    1 Reply Last reply
                                    Reply Quote 0
                                    • Dave RD
                                      Dave R
                                      last edited by

                                      TIG,

                                      It's not all Macs that have problems, though. It works just fine on mine. Could it be another plugin or something?

                                      Etaoin Shrdlu

                                      %

                                      (THERE'S NO PLACE LIKE)

                                      G28 X0.0 Y0.0 Z0.0

                                      M30

                                      %

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

                                        As I suspected 😞 😒
                                        I'll sleep on it... and see how I can devise a work around in my sleep...
                                        PC works fine - come on Mac's what's up with you !!! ❓
                                        Is it a particular version of Mac OS and the Ruby version that they have ??? πŸ˜•

                                        TIG

                                        1 Reply Last reply
                                        Reply Quote 0
                                        • D
                                          driven
                                          last edited by

                                          well, mine are
                                          both running SU 7.1
                                          both running OSX 10.5.8
                                          both running Ruby version 1.8.6
                                          MacBookPro is a fresh SU instal with just v1.4 bits
                                          iMac is littered with rubies but very few clashes are left roaming free, it is also running rubygems, but that doesn't seem to effect any thing else in SU

                                          both give same error

                                          john

                                          learn from the mistakes of others, you may not live long enough to make them all yourself...

                                          1 Reply Last reply
                                          Reply Quote 0
                                          • Dave RD
                                            Dave R
                                            last edited by

                                            Must be something wrong with my Mac, then.

                                            Etaoin Shrdlu

                                            %

                                            (THERE'S NO PLACE LIKE)

                                            G28 X0.0 Y0.0 Z0.0

                                            M30

                                            %

                                            1 Reply Last reply
                                            Reply Quote 0

                                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                            With your input, this post could be even better πŸ’—

                                            Register Login
                                            • 1
                                            • 2
                                            • 6
                                            • 7
                                            • 8
                                            • 9
                                            • 10
                                            • 9 / 10
                                            • First post
                                              Last post
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement