File Size Ruby
-
I have made some very big models recently because of adding a lot of detail. It seems Sketchup's Model Infosettings are in bytes and kilobytes which mean very little to me. It would be nice to see the file size in Megabytes with a click without having to call up the online calculator and transfer the numbers.
Is there a ruby that will do that? I have checked but haven't found it. The reason the files are getting so big is that I am modeling industrial process loops and the equipment that runs it. Thanks
-
You need a calculator to divide by 1000?
-
@alan fraser said:
You need a calculator to divide by 1000?
Depends if he means KB (1000) or KiB (1024) - KiB isn't so easy to do in your head.
-
This one-line copy/pasted into the Ruby Console returns that [saved] SKP's size in Megabytes
((File.stat(Sketchup.active_model.path).size)/1048576.0).to_s+" Megabytes"
I'll leave it up to you to make the menu item or toolbar button etc...
-
Thanks guys and Thank You TIG for the code. I want to make it visable on my screen so I don't go crazy when adding bolts, etc. that may not be necessary to get the visual point across.
-
I am intrigued why you should need a lot of detail in bolts as per your example (threads drive this I guess?) in a big model - can't you separate the necessary detailed models for a particular part of the process and then add other models as needed?
If it is just for illustrative purposes, these could be combined as required in Layout if you used the Pro version - and your mention of industrial purposes suggests someone might pay for it..
-
Chris,
I am splitting the model up into smaller pieces now and it works much better. Still learning. The code TIG gave me works great.
Advertisement