[Plugin] C of G Reporter 1.3
-
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... -
there is no accent in my path ....
cofgreporter
undefined method `definition' for #Sketchup::Group:0xe005344
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 -
Have you save your file SKp in the samme path?
-
Bertier
Did you install v1.2
Although it might still fail you should get more error messages... -
Heres's v1.3 http://forums.sketchucation.com/viewtopic.php?p=278046#p278046
It corrects the glitch that a few users might get with 'group.definition' - OK if you have some of my other tools installed but not this one alone - now sorted...
Please try and report back... -
hooray !
it's working :
cofgreporter
CofG Report written to
'F:\neo batitrad\Bar_Ka/console_CofG_Report.csv'
nilnice.
-
for some reason, using CoG makes SU "not responding"....
any clues ?
-
@bertier said:
for some reason, using CoG makes SU "not responding"....
any clues ?There's a lot of intensive stuff needed to 'integrate' possibly hundreds of slices through the selected object and find their common centroids...
You should get a 'count-down' 'nnn of mmm' report in the VCB and then a '...processing ......' ?
It will finish eventually... -
Hi, this is a very interesting plugin. I'm going to try it.
Two things struck me.
1st The rounding of numbers (but this is something I can work with ... )
2nd Hollow objects (pipes, etc.) are calculated as full volumes.Can this be repaired with the hollow objects? That would be great.
-
You can edit the number of dp's in the code - in the lines around the first half of the 300s...
I'm unsure about your comment - objects that are individual 'solids' are reported correctly - even when there are hollows. However, if you combine objects into a group it will by its nature cease to be a true manifold solid as there are internal 'partitions' - therefore sometimes the volume calculations can be awry. You should take the CofG of the parts and then make a combined CofG - this is also important if the parts have different densities...
Can you supply an example where manifold solid objects are returning incorrect values.
This one returns proper results even if the two groups are nested into one, as the 'slices' needed to calculate the CoG are maintained - but it is not always possible... -
I installed this plug in today but it does not appear on any of the SketcUp 2023 menus. How do I get a report?
-
Read the first post in this thread...
@unknownuser said:
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.
Advertisement