PLUGIN REQUEST: export component thumbnail as image

PLUGIN REQUEST: export component thumbnail as image

Postby pibuz » Fri Oct 16, 2020 4:44 pm

Hi guys,
I hope some of you PRO coders can help me out. I'm thinking about Fredo, given the fact that the request I'd need is somewhat similar to his wonderful FredoPortrait...

I have NO coder knowledge, so i really don't know if what I'm requesting is tough or easy to achieve..

BTW, I kind of have the need to quickly export all the selected components' thumbnail as JPEG/PNG images, named after the component instances' names. I have re-elaborated a few code lines I found somewhere here on the forums, but it's only partial: I'd also like to have the possibility to specify what resolution would be the exporting image. Would be cool also (but not needed) to have the possibility to specify the destination folder..

I'm attaching the basic code lines and thumbnail I made.

Thank you in advance!!!
0

pibuz 
 

Re: PLUGIN REQUEST: export component thumbnail as image

Postby TIG » Fri Oct 16, 2020 7:07 pm

It is already in the API... e.g.
Code: Select all
Sketchup.active_model.definitions.find_all{|d|
  !d.group? && !d.image? }.each{|d|
  d.save_thumbnail("#{d.name}.png")
}

This basic code saves the components' SKP files into your default-folder, as set up in SketchUp's Preferences - probably your 'Documents' folder...
Obviously you can expand this basic code quite a lot...
0
TIG
User avatar
TIG 
Global Moderator
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to Plugins

Who is online

Users browsing this forum: 786mshan786, babydude, duchaifo3i, HAL, pabloarias and 12 guests

Visit our sponsors: