Help Me Create a Custom Sketchup Plugin to Auto-Populate My Layout Sheets

I am looking to create a plugin that will allow me to automatically populate my Layout template with all the scenes that I’ve created in my relevant 3D model.
Link to video walkthru of what I’d like to accomplish with my plugin: Layout AutoScene Plugin Request - YouTube

If you can help me write the Ruby code for this function, please respond back to me. It may take me a couple of days to check back, I’m new to this forum, but I’m very committed to making this work for myself as a big timesaver.
Thank you!

Please be aware that there are currently some limitations to the LayOut APIs.
These limitations make it difficult to easily update the viewports for a document created from a template.
(It is actually easier to replace viewports with new viewports of the same size and bounds.)

Hi thank you Dan. Perhaps it has to be a SketchUp only plugin in the Ruby API? Leave no code work to be done in Layout?

Would you prefer to chat over the phone or via zoom?

LayOut does not have a live API, so if it’s Ruby then it must run from within SketchUp’s application process.

I am not sure what the solution is for this. I’ve participated in discussions about the issue, but not yet tried to solve it.

Obviously, one brute force solution would be to recreate the LayOut file 100% with code rather than try to use a template with any existing viewports.
The template can have the title block and the viewport labels but the 2D locations of viewports would need to be known (somehow) to the extension.

LayOut API objects can not yet have attribute dictionaries attached to them, which would otherwise be a good way to “mark” rectangles with the name of a scene to be replaced with a model viewport.

Thinking … perhaps groups with a rectangle and a text object inside naming the scene with a “Viewport:” prefix?
The code could search for these groups and replace them with a viewport using the child rectangles bounds and set the scene per the given text.

Issues arise later if needing to update the viewports and you’ve manually added stuff to the LayOut document such as notes, dimensions, etc.

There is an open issue, where removing a model viewport does not seem to work.