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.
<SDK_PATH>
is the location where the SDK package is extracted.
- Add
<SDK_PATH>\headers
to the include paths. - Link against
<SDK_PATH>\binaries\sketchup\x64\sketchup.lib
(Do not link againstSketchUpAPI.lib
!)
- Add
<SDK_PATH>
to framework search paths. - Set
/Applications/SketchUp 2023/SketchUp.app/Contents/MacOS/SketchUp
as the bundle loader. (Do not link againstSketchUpAPI.framework
!)
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.
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.