Pergunta

I have code using the SketchUp C++ API, which works on SketchUp 8 files. Trimble has replaced this with a C API, and SketchUp 2013 exports files that only the newer C API can open.

The solution is to port the code to the new C API. However, I'm under a bit of a time crunch for other reasons, so I was curious to know if one of these temporary solutions were already available, i.e. if someone has already implemented one of them:

a) a function in the C API that saves in SketchUp 8 format. This would let me create a small binary that opens the SKP 2013 file, save it as SKP 8, and keep using the C++ code untouched for some time longer, because it only reads SKP 8 files. The ruby API does not support this "save as SKP 8" call.

b) code that parses the SKP structure using the newer C API and then recreates it using the deprecated C++ API, possibly then saving in SketchUp 8 format. Has anyone implemented this? This would serve as an adequate front-end to the existing C++ code until it can be properly ported. I realize the work required to write this is largely the work required to simply port to the newer API, but if someone has implemented this already, that would be useful.

Thanks for any help.

Foi útil?

Solução

To answer part A: no, the new SketchUp API will not let you choose a SketchUp version when you save. There's currently no way to do this through the API.

For part B, I'm not aware of anyone who's done this, though it is an interesting idea. The work would be significant, because you'd have to map everything from the C API to the C++ API, but then you could effectively convert from SU2013 to SU8.

Make sure to read the migration guide document in the SketchUp 2013 SDK, which explains how to port any SU8 importers and exporters without having to port to the C API.

Also, one thing you should know is that we've recently updated the SDK with a version of SkpReader that will actually read SU2013 SKP files. That may solve your problem for you.

Best of luck,

Paul

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top