Skip to main content

The ABC's of LayOut's C API

We’re proud to announce our first step towards an extension ecosystem for LayOut in SketchUp Pro. Developers can now use a new C API to write code that reads, writes and modifies LayOut files. Cue the (surprisingly quiet) sound of a million programmers cheering.

So what does this mean for you if you don’t code? In short, it means more external tools that can potentially save you lots of time, developed by an international community of third-party developers.

To give you a sense of what’s possible, Adam (our LayOut API guru) built a simple example extension that solves a problem that might sound familiar: you want to quickly print multiple views of your in-process model (including scaled orthographics) so you can have an impromptu sketching session with your client or collaborators.

Printing every single scene (with some at a specified scale) directly from SketchUp can take a lot of thinking and time, especially if you have a lot of scenes. With just a few clicks, the extension renders each scene in your SketchUp model to a separate page in a new LayOut document—ready to print, export or otherwise annotate to your heart’s content.

SketchUp model into a 27-page LayOut file
It took our sample extension 35 seconds to turn the 27 scenes in my SketchUp model into a 27-page LayOut file.

After installing the extension, just set up your scenes in SketchUp, save your model, run the “Create LayOut File from Scenes” command, and pick your paper size and orientation. If your model has 20 scenes, your new LayOut file will have 20 pages, each conveniently labeled with the appropriate scene name. Keep the pages you want and delete the rest. You can tweak settings to make each view look exactly the way you want, and quickly set scales for orthographic viewports.

And there you have it: the first-ever extension for LayOut. There are several other ways developers can manipulate LayOut files using this resource, and we’re excited to continue powering up the API so that extension developers can build more powerful drawing and documentation tools on top of LayOut.

Speaking of which… Psst! Developers:

The LayOut C API documentation is included in the SketchUp SDK package. You’ll find more examples and the rules for LayOut’s Document Object Model in the SDK. We’d like to hear your thoughts; post feedback on our developer forum. Now go have fun!

About the Author

Sandra is the product manager for LayOut in SketchUp Pro. After eleven years of carrying around this box, her arms are very tired.

Profile Photo of Sandra Winstead