I want to program something in the layout ruby (i don’t know how to use C)
I want to make from my sketchup model a layout-file with the use of a template layout-file. (And then also do a few other steps.)
I probably have found a way, but it seems a bit a long side road:
Open the layout-template: doc = Layout::Document.new(path_template)
(now the layout model is yet not connected with the sketchup-model you want)
Iterate over all Layout::SketchUpModel entities with each and do:
2.1 Get all the information (bounds, scenes, …) of the current Layout::SketchUpModel and put it in tmp parameters
2.2 Remove the current entity(Layout::SketchUpModel) doc.remove_entity()
(still have to try if this works when iterating over them)
2.3 Make a new entity with layout_view = Layout::SketchUpModel.new(path_SU_model, bounds)
2.4 Put that entity in the layout file doc.add_entity(layout_view, layer, page)
If you actually want to see the layout file, then you still have to save it: doc.save(filename)
You can probably also do first 2.3 and 2.4 when the ‘old’ layout view is still in the doc and do remove 2.2 after that.
When you manually do that, you just have to send it to layout and select a template and your done. So, it seems like a bit a complicated solution to do something simple. Also i have doubts if i will be able to get the views in layout exactly the same as they where.
Does anyone knows a better way?
Also, is there a web page like ‘coming soon in SU-2020’ ?
Will Sketchup make more possibilities with that Layout Ruby API?
So, before i program all this, i would like to know if there is an easier way (or coming soon)?
Trimble employees are not allowed to make “forward looking statements” (as Trimble is a publicly traded company and/or it’s just policy because the software market is very competitive.)
So no there is no such website and you’ll know when the next version is released and the API release notes are published.
You set up scenes in the SketchUp model for use as viewports in the LayOut document. This means you’ll usually also create some scenes that are only used for modeling (so you don’t mess up your LO viewports when modeling and moving the camera around.)
Just keep in mind that the index order for the current_scene= method is 1 more than the scene index in SketchUp (because 0 is used for the “Last Saved SketchUp View” in LO. Avoid using this and setup scenes inside SketchUp.)
It is also common to setup scenes and styles just for printing and making presentation images in the model.
NO. This thread is about a specific scenario where a LayOut document template that has preset model viewports. The original poster for this scenario needs to load the current model in SketchUp into one of the preset viewports (which is the first preset viewport on the first page of the new LO document made from the template file.)
So no it’s not a generic “Send to LayOut” clone.
Why not read the feature request that is logged in the official API Issue tracker ?
FYI: In the LayOut API they named the viewport object class Layout::SketchUpModel so that is what the references old_model and new_model are referring to … “the old viewport” and “new viewport” objects.
They are needed because of an oversight in omitting a way to set a LO viewport’s path to a model file.
That nice, but you are not using a LO file template, so this topic thread has nothing to do with your situation, … and everything from this statement on down is off-topic. Please begin a new topic thread for specific questions regarding your specific coding challenges.