Skip to content

Latest commit

 

History

History
47 lines (26 loc) · 1.98 KB

README.md

File metadata and controls

47 lines (26 loc) · 1.98 KB

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