Just curious, … you are not using the built-ins ?
SketchUp C API: SketchUpModelExporterInterface
SketchUp C API: SketchUpPluginProgressCallback