New Material Collection

materials

#1

How can i create new material collection and fill it with loaded materials ?


#2

The Ruby API doesn’t expose the material libraries. You can only manage the material in the model (model.material) and import/export SKM files.

You can file feature requests in our GitHub issue tracker: https://github.com/SketchUp/api-issue-tracker/issues


#3

no work around ?


#4

I had a quick attempt…

You can get a location where SU looks for Materials:

Sketchup.find_support_file('Materials')
# => C:/Users/Thomas/AppData/Roaming/SketchUp/SketchUp 2018/SketchUp/Materials

I then created a new directory and added a SMK file:

image

Then it appeared at the end of the material library list. (Though I’m not sure if you need to restart SU for it to appear.)

Note that the location of this ‘Materials’ folder was in older versions of SketchUp under Program Files. Which means that users without admin rights wasn’t able to write to it.


#5

GREAT, THANKS THAT IS EXACTLY WHAT IM LOOKING FOR :smiley:
THANK YOU


#6

And you’ll need to use Ruby standard FileUtils library.

I’ve logged FRs already (several years ago predating the public issue tracker) for access to ALL of SketchUp’s resource collections, ie to register new local collections and add favorites, etc., so the user would not need to change resource folder nor restart SketchUp.

(These requests should be logged internally already.)