Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/SketchUp/sketchup-live-c-api

Examples demonstrating how to use the SketchUp Live C API
https://github.com/SketchUp/sketchup-live-c-api

c cmake cpp example extension ruby sketchup vscode

Last synced: 5 days ago
JSON representation

Examples demonstrating how to use the SketchUp Live C API

Awesome Lists containing this project

README

        

# SketchUp Live C API Examples

_These examples are for usage within the SketchUp desktop application. They will not work for usage in other applications._

The [SketchUp C API](https://extensions.sketchup.com/sketchup-sdk) is mainly used for the following:

* Read/Write `.skp` files in applications other than SketchUp.
* Create Importers/Exporters for SketchUp.

A third usage, officially supported since SketchUp 2019.2 it allows _read only_ access to the open SketchUp model via [Ruby C extensions](https://github.com/SketchUp/ruby-c-extension-examples).

This is a guide demonstrating how to setup and build your own Ruby C extension that uses the SketchUp C API to read from the active model.

## General Instructions

`` is the location where the SDK package is extracted.

### Windows

* Add `\headers` to the include paths.
* Link against `\binaries\sketchup\x64\sketchup.lib` (Do **not** link against `SketchUpAPI.lib`!)

### macOS

* Add `` to framework search paths.
* Set `/Applications/SketchUp 2023/SketchUp.app/Contents/MacOS/SketchUp` as the bundle loader. (Do **not** link against `SketchUpAPI.framework`!)

## CMake Example Project

The code in this repository will demonstrate a [CMake](https://cmake.org/) project for a Windows & Mac builds. This CMake project can be used to create a [Visual Studio solution](https://visualstudio.microsoft.com/), [Xcode project](https://developer.apple.com/xcode/).

* [How to build the CMake example project](docs/cmake.md)
* [How to build the CMake example project via VSCode](docs/cmake-vscode.md)

## Editor Instructions

For those who prefer not to use CMake there is documentation for setting up the following IDEs/editors directly:

* [Visual Studio](docs/visual-studio.md)
* [XCode](docs/xcode.md)

Visual Studio and Xcode is the main IDEs we work with. We welcome pull-requests if you want to contribute documentation for setting up your favorite editor.

## See Also

* [Using the Live C API](docs/using-live-c-api.md)