How can i create new material collection and fill it with loaded materials ?
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
no work around ?
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:
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.
GREAT, THANKS THAT IS EXACTLY WHAT IM LOOKING FOR
And you’ll need to use Ruby standard
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.)