Skip to content

Examples demonstrating how to use the SketchUp Live C API

License

Notifications You must be signed in to change notification settings

SketchUp/sketchup-live-c-api

Repository files navigation

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 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.

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

<SDK_PATH> is the location where the SDK package is extracted.

Windows

  • Add <SDK_PATH>\headers to the include paths.
  • Link against <SDK_PATH>\binaries\sketchup\x64\sketchup.lib (Do not link against SketchUpAPI.lib!)

macOS

  • Add <SDK_PATH> 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 project for a Windows & Mac builds. This CMake project can be used to create a Visual Studio solution, Xcode project.

Editor Instructions

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

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

Releases

No releases published

Packages

No packages published