by TIG » Mon Mar 08, 2010 3:42 pm
driven A mystery... - Code: Select all
def CofGravity::calculate ### LINE 129 ==start of class/def that is reporting the error...
def db(string) dir=File.dirname(__FILE__)+"/TIGtools" toolname="CofGravity" locale=Sketchup.get_locale.upcase path=dir+"/"+toolname+locale+".lingvo" if not File.exist?(path) return string else deBabelizer(string,path) end end#db
if (Sketchup.version.split(".")[0].to_i<5) UI.messagebox(db("C of G: Sorry, this is Version >= 6 Tool !")) return nil end#if
model=Sketchup.active_model entities=model.active_entities
############ if Sketchup.version[0,1].to_i > 6 model.start_operation((db("C of G")),true)### LINE 153 GIVES ERROR !!!
Can you look at the script's contents and see if it looks like this ? Works fine on a PC for me - can't see where a Mac might trip up ? 
TIG
-

TIG
- Global Moderator
-
- Posts: 20295
- Joined: Mon Nov 12, 2007 7:24 pm
- Location: Northumbria UK
- Name: TIG
- Operating system: Windows
- SketchUp version: 2021
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
by Jim » Mon Mar 08, 2010 4:01 pm
Need to require 'dBabelizer' before you use it.
Hi
-
Jim
- Global Moderator
-
- Posts: 4678
- Joined: Mon Nov 12, 2007 10:13 pm
- Location: ohio
- Name: Jim
- Operating system: Windows
- SketchUp version: 2017
- License type: Pro
- SketchUp use: hobby
- Level of SketchUp: Intermediate
-
by TIG » Mon Mar 08, 2010 4:05 pm
Jim That's it ! Thanks. Other tools requiring it were masking the fact I missed it out of the initial 'require'... Update on it's way !!!
TIG
-

TIG
- Global Moderator
-
- Posts: 20295
- Joined: Mon Nov 12, 2007 7:24 pm
- Location: Northumbria UK
- Name: TIG
- Operating system: Windows
- SketchUp version: 2021
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
by driven » Mon Mar 08, 2010 4:10 pm
that appears exactly the same, the only thing that seems at odds is the syntax colouring for calculate shows it as a variable?? I don't know enough to know why, or where to look next CoG-syntax.jpg I'll send this even if the missing "require" is at fault, because I don't understand why one and not the other would be a variable....
learn from the mistakes of others, you may not live long enough to make them all yourself...
-
driven
- PluginStore Author

-
- Posts: 3034
- Joined: Fri May 01, 2009 11:50 pm
- Name: driven
- Operating system: Mac
- SketchUp version: 2015
- License type: Pro
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Intermediate
by TIG » Mon Mar 08, 2010 4:13 pm
Here's v1.3... viewtopic.php?p=229404#p229404The initial 'require' of deBabelizer was accidentally missed out, but its absence was masked by some other tools loading it anyway so most times it worked anyway... Now it is explicitly called for in the tool... Sorry for the confusion...
TIG
-

TIG
- Global Moderator
-
- Posts: 20295
- Joined: Mon Nov 12, 2007 7:24 pm
- Location: Northumbria UK
- Name: TIG
- Operating system: Windows
- SketchUp version: 2021
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
by driven » Mon Mar 08, 2010 4:20 pm
Same error code, same syntax colouring for line 813
seems to have something to do with it...
learn from the mistakes of others, you may not live long enough to make them all yourself...
-
driven
- PluginStore Author

-
- Posts: 3034
- Joined: Fri May 01, 2009 11:50 pm
- Name: driven
- Operating system: Mac
- SketchUp version: 2015
- License type: Pro
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Intermediate
by TIG » Mon Mar 08, 2010 4:34 pm
driven
Have you got the recent v1.3, with the require 'deBabelizer.rb' added ? This should fix it ?
TIG
-

TIG
- Global Moderator
-
- Posts: 20295
- Joined: Mon Nov 12, 2007 7:24 pm
- Location: Northumbria UK
- Name: TIG
- Operating system: Windows
- SketchUp version: 2021
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
by TIG » Mon Mar 08, 2010 4:37 pm
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
-

TIG
- Global Moderator
-
- Posts: 20295
- Joined: Mon Nov 12, 2007 7:24 pm
- Location: Northumbria UK
- Name: TIG
- Operating system: Windows
- SketchUp version: 2021
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
by driven » Mon Mar 08, 2010 4:46 pm
Yes it's v1.3 changed to tig_calculate (lines 131, 815) - Code: Select all
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
learn from the mistakes of others, you may not live long enough to make them all yourself...
-
driven
- PluginStore Author

-
- Posts: 3034
- Joined: Fri May 01, 2009 11:50 pm
- Name: driven
- Operating system: Mac
- SketchUp version: 2015
- License type: Pro
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Intermediate
by TIG » Mon Mar 08, 2010 4:52 pm
driven wrote:Yes it's v1.3 changed to tig_calculate (lines 131, 815) - Code: Select all
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
-

TIG
- Global Moderator
-
- Posts: 20295
- Joined: Mon Nov 12, 2007 7:24 pm
- Location: Northumbria UK
- Name: TIG
- Operating system: Windows
- SketchUp version: 2021
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
by TIG » Mon Mar 08, 2010 4:55 pm
Here's v1.4 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
-

TIG
- Global Moderator
-
- Posts: 20295
- Joined: Mon Nov 12, 2007 7:24 pm
- Location: Northumbria UK
- Name: TIG
- Operating system: Windows
- SketchUp version: 2021
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
by chrisjk » Mon Mar 08, 2010 5:09 pm
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
Last edited by chrisjk on Mon Mar 08, 2010 5:27 pm, edited 1 time in total.
Chris
-
chrisjk
- Premium Member

-
- Posts: 297
- Joined: Fri Dec 05, 2008 8:16 am
- Location: Keston, England
- Name: chrisjk
- Operating system: Mac
- SketchUp version: 2019
- License type: Pro
- SketchUp use: woodworking
- Level of SketchUp: Intermediate
by driven » Mon Mar 08, 2010 5:10 pm
Ok, v1.4 - Code: Select all
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...
-
driven
- PluginStore Author

-
- Posts: 3034
- Joined: Fri May 01, 2009 11:50 pm
- Name: driven
- Operating system: Mac
- SketchUp version: 2015
- License type: Pro
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Intermediate
by Gaieus » Mon Mar 08, 2010 5:12 pm
TIG wrote:...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! 
-

Gaieus
-
- Posts: 27379
- Joined: Sat Oct 20, 2007 8:24 am
- Location: Pécs, Hungary
- Name: Csaba Pozsárkó
- Operating system: Windows
- SketchUp version: 2013
- License type: Pro
- SketchUp use: historical reconstruction
- Level of SketchUp: Advanced
-
by TIG » Mon Mar 08, 2010 5:20 pm
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
-

TIG
- Global Moderator
-
- Posts: 20295
- Joined: Mon Nov 12, 2007 7:24 pm
- Location: Northumbria UK
- Name: TIG
- Operating system: Windows
- SketchUp version: 2021
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
by driven » Mon Mar 08, 2010 5:27 pm
it is in the db method, I just ran composite on to groups and got this - Code: Select all
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...
-
driven
- PluginStore Author

-
- Posts: 3034
- Joined: Fri May 01, 2009 11:50 pm
- Name: driven
- Operating system: Mac
- SketchUp version: 2015
- License type: Pro
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Intermediate
by chrisjk » Mon Mar 08, 2010 5:32 pm
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
-
chrisjk
- Premium Member

-
- Posts: 297
- Joined: Fri Dec 05, 2008 8:16 am
- Location: Keston, England
- Name: chrisjk
- Operating system: Mac
- SketchUp version: 2019
- License type: Pro
- SketchUp use: woodworking
- Level of SketchUp: Intermediate
by TIG » Mon Mar 08, 2010 5:38 pm
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
-

TIG
- Global Moderator
-
- Posts: 20295
- Joined: Mon Nov 12, 2007 7:24 pm
- Location: Northumbria UK
- Name: TIG
- Operating system: Windows
- SketchUp version: 2021
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
by DSG2k » Mon Mar 08, 2010 6:45 pm
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.
-
DSG2k
-
- Posts: 2
- Joined: Sat Mar 06, 2010 11:44 pm
by TIG » Mon Mar 08, 2010 11:11 pm
Seems to work fine on PC but on Mac it falls over... I WILL find a solution... 
TIG
-

TIG
- Global Moderator
-
- Posts: 20295
- Joined: Mon Nov 12, 2007 7:24 pm
- Location: Northumbria UK
- Name: TIG
- Operating system: Windows
- SketchUp version: 2021
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
by driven » Mon Mar 08, 2010 11:21 pm
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...
-
driven
- PluginStore Author

-
- Posts: 3034
- Joined: Fri May 01, 2009 11:50 pm
- Name: driven
- Operating system: Mac
- SketchUp version: 2015
- License type: Pro
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Intermediate
by driven » Mon Mar 08, 2010 11:29 pm
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...
-
driven
- PluginStore Author

-
- Posts: 3034
- Joined: Fri May 01, 2009 11:50 pm
- Name: driven
- Operating system: Mac
- SketchUp version: 2015
- License type: Pro
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Intermediate
by Dave R » Mon Mar 08, 2010 11:31 pm
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
%
-

Dave R
- Global Moderator
-
- Posts: 18187
- Joined: Tue Nov 13, 2007 11:52 pm
- Location: SE Minnesota
- Name: Dave R
- Operating system: Windows
- SketchUp version: 2021
- License type: Pro
- SketchUp use: woodworking
- Level of SketchUp: Advanced
by TIG » Mon Mar 08, 2010 11:33 pm
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
-

TIG
- Global Moderator
-
- Posts: 20295
- Joined: Mon Nov 12, 2007 7:24 pm
- Location: Northumbria UK
- Name: TIG
- Operating system: Windows
- SketchUp version: 2021
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
by driven » Mon Mar 08, 2010 11:56 pm
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...
-
driven
- PluginStore Author

-
- Posts: 3034
- Joined: Fri May 01, 2009 11:50 pm
- Name: driven
- Operating system: Mac
- SketchUp version: 2015
- License type: Pro
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Intermediate
by Dave R » Tue Mar 09, 2010 12:05 am
Must be something wrong with my Mac, then.
Etaoin Shrdlu
%
(THERE'S NO PLACE LIKE)
G28 X0.0 Y0.0 Z0.0
M30
%
-

Dave R
- Global Moderator
-
- Posts: 18187
- Joined: Tue Nov 13, 2007 11:52 pm
- Location: SE Minnesota
- Name: Dave R
- Operating system: Windows
- SketchUp version: 2021
- License type: Pro
- SketchUp use: woodworking
- Level of SketchUp: Advanced
by driven » Tue Mar 09, 2010 12:09 am
Dave R wrote:Must be something wrong with my Mac, then.
yeh, you sure it's not a PC....
learn from the mistakes of others, you may not live long enough to make them all yourself...
-
driven
- PluginStore Author

-
- Posts: 3034
- Joined: Fri May 01, 2009 11:50 pm
- Name: driven
- Operating system: Mac
- SketchUp version: 2015
- License type: Pro
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Intermediate
by Dave R » Tue Mar 09, 2010 12:16 am
Very funny.  I have both and I know the difference. Here's proof that it works on my Mac. 
Etaoin Shrdlu
%
(THERE'S NO PLACE LIKE)
G28 X0.0 Y0.0 Z0.0
M30
%
-

Dave R
- Global Moderator
-
- Posts: 18187
- Joined: Tue Nov 13, 2007 11:52 pm
- Location: SE Minnesota
- Name: Dave R
- Operating system: Windows
- SketchUp version: 2021
- License type: Pro
- SketchUp use: woodworking
- Level of SketchUp: Advanced
by wind-borne » Tue Mar 09, 2010 12:40 am
works ok on my Mac but TIG Tools folder replaced existing one so extrusion toolbar icons disappeared. I see missing icons on Dave's screenshot also.
"To read between the lines was easier than to follow the text."OSX 10.11.6 _ _ _ _ _ SU 8 pro
-

wind-borne
- Premium Member

-
- Posts: 220
- Joined: Thu Sep 17, 2009 4:05 am
- Location: HI
- Name: wind-borne
by chrisjk » Tue Mar 09, 2010 6:41 am
Most mysterious. I have tried with no other plugins or tools in the respective folders and using CofG version 1.4 I still get:- - Code: Select all
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 /Library/Application Support/Google SketchUp 7/SketchUp/Plugins/CofGravity.rb:156:in `call' /Library/Application Support/Google SketchUp 7/SketchUp/Plugins/CofGravity.rb:156
Chris
-
chrisjk
- Premium Member

-
- Posts: 297
- Joined: Fri Dec 05, 2008 8:16 am
- Location: Keston, England
- Name: chrisjk
- Operating system: Mac
- SketchUp version: 2019
- License type: Pro
- SketchUp use: woodworking
- Level of SketchUp: Intermediate
by Ad Machine » 5 minutes ago
-
Ad Machine
- Robot
-
- Posts: 2012
-
Return to Plugins
|