I have good knowledge about the Ruby API, can we achieve all those things with C++ too?
I went through the documentation for Sketchup C SDK but didn’t understand much.
@tt_su This would be a good subject for a Developer blog article.
There are still some parity issues between the 2 APIs, see the official SketchUp API Issue Tracker:
SketchUp API Issue Tracker: label(“C API”) label(“parity”)
The introduction page still says …
The SketchUp C API is an interface for reading and writing data to and from SketchUp models. This API interacts directly with SketchUp files (.skp). It can create new ones as well as read or modify existing ones.
However, (for several versions now) it can also be used within the SketchUp application to read “live” models. There was warning not to use the C API functions to change a “live” model, but I’d like to ask @tt_su or @bugra whether this is still generally true or not.
There are examples by the Trimble Team for using the C API for SketchUp extensions …
Thanks for sharing these
The C API within SketchUp itself is still strictly read-only.
The C API used outside of SketchUp can be used to create and modify models.
Generally the C API is used by importers/exporters for for applications looking to handle the .skp file format. Some SketchUp extensions, such as rendering engines, use it to parse the model as quickly as possible since they often have a real time rendering mode that require maximum performance with frequent updates.
Sorry to bump a 4-year-old thread, but it’s relevant.
Does the “read-only” limitation apply only to the model entities? Or does it mean that any IO / File operations (like saving an image, component, style, thumbnail, etc.) are likewise off limits even though those activities do not change anything in the model?
I’ve been trying to pass a Style entity to C for the purpose of writing it to a file and everything I’ve tried is crashing SU. I’m sure it’s probably my code, but before I invest any more time into the effort, I’d like to know it’s actually possible.
Thanks Thomas
Rick