Is there any documentation for C exporter interface?

I’m struggling to understand a third party C exporter and though I could start by reading up on the documentation. However, I’ve found absolutely none!

The first header within the SDK docs regards importers and exporters but I cannot find any other information about this alleged interface.

I’ve tried the search field on the page, text search in the documentation folder and frantically clicking the header and its paragraph in search for a hidden link.

Is the examples folder (samples) the only thing we have to go on to figure out how this interface works? Is there no text describing how to get something (a class?) to register as an exporter and what functions it must/may have and what they are used for?

Eneroth3,
The HTML documentation is not currently generating as part of the SDK at this time, but that documentation does exist on the header file:

headers/sketchupapi/import_export/modelexporterplugin.h

In short, an exporter defines a class inheriting from SketchUpModelExporterInterface

SketchUp will scour the Exporters folder, and on each DLL in there try and call GetSketchUpModelExporterInterfaceFunc, and with the resulting instance, will try and enumerate what format(s) it supports. When the user selects the exporter, it’s ConvertFromSkp function will be called, and it will be given a temporary copy of the skp file to export. Existing C API functions can then be used to enumerate and iterate over the file to carry out the export.

Feel free to reach to contact @ChrisFullmer or I about anything you need related to the interface.

Best Regards,
Nick Gully

2 Likes

Thanks Nick!

I thought the HTML files included documentation generated from all code files, similarly to what you get from using YARD in a Ruby project. This is the stuff I was looking for!

Having read up on this makes it much easier to mentally parse the exporter in question, especially as I’m very green to C++ programming.

Personally It also helps a lot to be able to learn the tiny details, like how the file extension should be returned without a leading dot, rather than having unanswered (and for the time being, irrelevant) questions taking up my brain’s memory when trying to see the big picture.

Follow up question: do importers need to be recompiled for new SU versions or can the same DLL be re-used for as long as the importer C API stays the same? The lazy forethoughtful part of me has been reluctant to use Ruby C extensions as they need to be recompiled when the SKetchUp Ruby interpreter is updated, but maybe that doesn’t apply here?

In between versions of SketchUp where the compiler didn’t change, the interface should have remained the same and have binary compatibility:

SU2014 - SU2016 used VS2010 runtime.
SU2017 - SU2019 used VS2015 runtime.

2 Likes