[Plugin] C of G Reporter 1.3

[Plugin] C of G Reporter 1.3

Postby TIG » Sat Oct 09, 2010 2:34 pm

(c) TIG 2010
Permission to use, copy, modify, and distribute this software for
any purpose and without fee is hereby granted, provided that the above
copyright notice appear in all copies.
THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
___________________________________________________________________________

cofgreporter.rb >>> ../Plugins/ folder
___________________________________________________________________________
Usage:
Use this after adding some CofG's [i.e. 'Center of Gravity' tags]
Type 'cofgreporter' in the Ruby Console.
If the Model SKP is new and has not yet been saved you will get an error.
If there are no CofG's to Report you will get an error.
If the destination CofG Report cannot be written -
e.g. it's already open in Excel - you will get an error.
Otherwise a CofG Report is written into the Model's folder.
It is named to match the Model -
e.g. 'MyModel.skp' and 'MyModel_CofG_Report.csv'
A '.csv' file can be opened in Excel etc.
Link the .csv into a pre-formated .xls file with additional 'sums' etc, so
that it auto-updates.
It is sorted alphanumerically and reports
'ID' 'Weight' 'Volume' - the final two are in the units used in the CofG's.
The 'ID' is the CofG name-tag based on the original Instance's name, but
remember that you might have adjusted this in the dialogs during the making
of the CofG's - i.e. it is as displayed in the CofG's text-tag, not
necessarily the Instance's name.
___________________________________________________________________________
Donations:
by PayPal to info @ revitrev.org
___________________________________________________________________________
Version:
1.0 20101009 First release.
1.1 20101010 csv defined outside of begin/rescue.
1.2 20101010 Extra rescue error messages added.
1.3 20101010 Glitch with some users' "group.definition" fixed.
___________________________________________________________________________
cofgreporter.rb
1
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] C of G Reporter

Postby watkins » Sat Oct 09, 2010 4:14 pm

Dear TIG,

Sorry for being dense, but does this plugin calculate the C_of_G of a shape? I do not understand the reference to adding CofGs.

Kind regards,
Bob
0

watkins 
 

Re: [Plugin] C of G Reporter

Postby pilou » Sat Oct 09, 2010 4:16 pm

So speedy as usual :fro:
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] C of G Reporter

Postby pilou » Sat Oct 09, 2010 4:25 pm

@Tig : Can you write result with a little Offset?
Result are always in front of something even we rotate or scale the object :)
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] C of G Reporter

Postby TIG » Sat Oct 09, 2010 4:28 pm

You need to use another tool 'Center of Gravity' to make the CofG tags first.
It's here viewtopic.php?p=229401#p229401
I wrote this 'Reporter' for Bertier who wants to be able to report weights of objects etc after tagging them with CofG data...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] C of G Reporter

Postby TIG » Sat Oct 09, 2010 4:34 pm

Pilou wrote:@Tig : Can you write result with a little Offset?
Result are always in front of something even we rotate or scale the object :)

Use Xray mode...
The tool is a utility not a presentation aid.
You can always move the text-tag by editing the CofG group...
:?
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] C of G Reporter

Postby pilou » Sat Oct 09, 2010 4:59 pm

You can always move the text-tag by editing the CofG group...

:idea: :thumb: :oops:
cofg1.jpg
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] C of G Reporter

Postby watkins » Sat Oct 09, 2010 7:53 pm

Dear TIG,

Thanks for the explanation.

Regards,
Bob
0

watkins 
 

Re: [Plugin] C of G Reporter

Postby TIG » Sat Oct 09, 2010 8:57 pm

Pilou wrote:
You can always move the text-tag by editing the CofG group...

Thanks, Pilou
...Comme toujours, je peut te faire confiance...
Aucun problème !
;)
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] C of G Reporter

Postby Krisidious » Sat Oct 09, 2010 9:50 pm

does this do Imperial Weights too?
0
By: Kristoff Rand
Home Designer
Unique House Plans
User avatar
Krisidious 
 

Re: [Plugin] C of G Reporter

Postby pilou » Sat Oct 09, 2010 10:46 pm

@Tig :)
Je peut no, Je peux yes
a very useful thing for French verbs and conjugation :enlight:
(on left top page: enter the verb, press ok ..and scroll )

conjugate.jpg
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] C of G Reporter

Postby TIG » Sat Oct 09, 2010 10:58 pm

Krisidious wrote:does this do Imperial Weights too?

If you use the 'imperial' measurements for the CogG volumes and density...
Possible units are "kg/m3", "tonnes/m3", "g/cm3", "tons/yd3", "lbs/ft3"
If others were preferred they could be added...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] C of G Reporter

Postby TIG » Sat Oct 09, 2010 11:10 pm

Pilou wrote:@Tig :)
Je peut no, Je peux yes

Pilou :(
I know!
I can..., thou canst..., he/she/it can..., we can..., you can... they can...? [can!]
My French is rubbish [but, so is your English! ;) ]
Je le sais!
Je peux..., tu peux...,il/elle peut..., nous pouvons..., vous pouvez... ils/elles peuvent? [pu!]
Mon Français est des déchets [mais c'est que t'anglais! ;) ]

In good humour...
Dans la bonne humeur ...
:D

???
l'eau is water
la peau is skin
Both of these nouns are considered male, there is no reason behind this it is just the way the language works!
Similarly there are rules for female nouns such as:
un périphérique is a peripheral
un graphique is a graph........................ :?
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] C of G Reporter

Postby Krisidious » Sat Oct 09, 2010 11:38 pm

excellente' sorry wrong language...

now another question... I know this is kinda off subject. what is the implication of this plugin, does this allude to a future where these weights could be transfered through shear force or straight line force?

the reason I ask is that I look forward to a time when I can build roofs, beams or arches and have their loads followed and measured.

SketchyPhysics got me excited about the possibility... that a model could have gravity and therefore transfer weight and force towards a central point.

thanks for another great plugin...
0
By: Kristoff Rand
Home Designer
Unique House Plans
User avatar
Krisidious 
 

Re: [Plugin] C of G Reporter

Postby TIG » Sun Oct 10, 2010 12:14 am

Kristoff

No reason why not... BUT we just haven't written it yet... :geek:
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] C of G Reporter

Postby pilou » Sun Oct 10, 2010 12:35 am

@ Tig
The big mystery is why so much languages? ;)
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] C of G Reporter

Postby Bertier » Sun Oct 10, 2010 7:25 am

MERCI / THANK YOU / Danke !

that is awsome !
0

Bertier 
 

Re: [Plugin] C of G Reporter

Postby Bertier » Sun Oct 10, 2010 8:37 am

Hello TIG

tryed it, got this :

cofgreporter
Error: #<TypeError: C:/Program Files/Google/Google SketchUp 8/Plugins/cofgreporter.rb:81:in `+': can't convert nil into String>
C:/Program Files/Google/Google SketchUp 8/Plugins/cofgreporter.rb:81
C:/Program Files/Google/Google SketchUp 8/Plugins/cofgreporter.rb:81:in `cofgreporter'
(eval):0
0

Bertier 
 

Re: [Plugin] C of G Reporter 1.1

Postby TIG » Sun Oct 10, 2010 11:29 am

Bertier

Here's v1.1 viewtopic.php?p=278046#p278046
The error in the error message is fixed!
Please retry...
To be on the safe site please ensure your file_path/skp_name contains no accented characters - SUp's Ruby is not happy with unicoded characters :(
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] C of G Reporter 1.1

Postby Bertier » Sun Oct 10, 2010 12:47 pm

will do now;

thank you
0

Bertier 
 

Re: [Plugin] C of G Reporter 1.1

Postby Bertier » Sun Oct 10, 2010 1:27 pm

new error message :

cofreporter
Error: #<NameError: undefined local variable or method `cofreporter' for main:Object>
(eval)
0

Bertier 
 

Re: [Plugin] C of G Reporter 1.1

Postby TIG » Sun Oct 10, 2010 1:29 pm

Bertier wrote:new error message :
cofreporter
Error: #<NameError: undefined local variable or method `cofreporter' for main:Object>
(eval)

It's cofgreporter - you mistyped! :roll:
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] C of G Reporter 1.1

Postby Bertier » Sun Oct 10, 2010 1:37 pm

oops...
0

Bertier 
 

Re: [Plugin] C of G Reporter 1.1

Postby Bertier » Sun Oct 10, 2010 1:40 pm

working but :

CoG Report File:
'F:\neo batitrad\Bar & Ka/console_CofG_Report.csv'
Cannot be written - it's probably already open.
Close it and try making the Report again...
Exiting.
nil


and it's not open, cause it's not written yet !
0

Bertier 
 

Re: [Plugin] C of G Reporter 1.2

Postby TIG » Sun Oct 10, 2010 3:36 pm

Bertier wrote:working but :
CoG Report File:
'F:\neo batitrad\Bar & Ka/console_CofG_Report.csv'
Cannot be written - it's probably already open.
Close it and try making the Report again...
Exiting.
nil
and it's not open, cause it's not written yet !

Try renaming the folder 'Bar & Ka' to 'Bar_Ka' - The '&' in the file_path might be the culprit ?
Also is your model SKP really called 'console.skp' ?
Try the version 1.2 which has more error messages, that might report what is really up...
viewtopic.php?p=278046#p278046
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] C of G Reporter 1.2

Postby TIG » Sun Oct 10, 2010 3:37 pm

Here's v1.2 viewtopic.php?p=278046#p278046
with some extra error reporting to try and trap Bertier's reported cryptic error messages...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] C of G Reporter 1.2

Postby Bertier » Sun Oct 10, 2010 5:22 pm

thank you TIG

I'll try this tonite, got to get the kids at their grand parents now.

where are you from ?
0

Bertier 
 

Re: [Plugin] C of G Reporter 1.2

Postby Rich O Brien » Sun Oct 10, 2010 5:30 pm

It's a secret but there's a clue in his profile ;)
0
There's a frontroom and a backroom....reverse faces
User avatar
Rich O Brien 
Administrator
 

Re: [Plugin] C of G Reporter 1.2

Postby pilou » Sun Oct 10, 2010 5:37 pm

If accents are forbidden, that is very annoyous for French Windows System :shock:
Because there is an accent for the principal Desk and for some of path! !!! :o
C:\Documents and Settings\Propriétaire\Bureau

PS I have not the use of this plug, but it's by curiosity :)

Of course now I obtain nothing :)
except this :) (i have saved my object with Cof as Untitled.skp
curious is the "/" and "\"


Code: Select all
cofgreporter
No such file or directory - C:\Documents and Settings\Propriétaire\Bureau/Untitled_CofG_Report.csv
CoG Report File:
'C:\Documents and Settings\Propriétaire\Bureau/Untitled_CofG_Report.csv'
Cannot be written - it's probably already open.
Close it and try making the Report again...
Exiting.
nil


Edit: That works when I use a path without accent for save my file! :fro: :thumb:
cvs.png
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] C of G Reporter 1.2

Postby TIG » Sun Oct 10, 2010 6:11 pm

The Unicode paradox is an annoying bit of Sketchup's Ruby - some of the 'File' functions don't work properly if there are accented characters etc in path_names etc... Sorry!
At least we know the cause of the problem...
The \ / is also from the same methods when you get the filepath on a PC it has \ separators [/ on MAC], when you join on the new file_name it's always with the as the ;joining; separator / - but it still works OK... :roll:
0
TIG
User avatar
TIG 
Global Moderator
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

Next


 

Return to Plugins

Who is online

Users browsing this forum: jtri, layercero, ruchanan and 19 guests

Visit our sponsors: