I’m sure the answer applies to all the built-in templates, but I’m specifically looking for Plain Tabloid Landscape. I suspect it will involve Sketchup.find_support_file
, but I’m not sure what the options are.
There are a couple of API request issues open for this:
-
Issue 96 : LayOut API methods to get support and resource paths - 2018
-
Issue 810 " Request: Layout array of Template Directories - Layout.template_dirs? - 2022
These discuss some of the problems especially on the Mac platform.
I did cobble together a method to parse the JSON preference file to extract a list of templates.
That was enough to get what I needed, thanks.
template_file_name = "#{Sketchup.find_support_file("../LayOut/templates/Paper")}\\Plain Paper\\Tabloid Landscape.layout"
doc = Layout::Document.new(template_file_name)
1 Like
But does it work on Mac also?
Good point. I’m rethinking this anyway, and plan to have the user select a template with the file dialog.