Is there a way to create a SUComponentDefinitionRef from a *.skp file? Or add a definition to a SUModelRef from a file? Or even create a SUComponentDefinitionRef from a SUModelRef?
Something similar to model.definitions.load(path) in the Ruby API.
I’ve recently started working with the SketchUp C API and the need of creating a SUComponentDefinitionRef from a skp file just came up. I found this question and tracking the issue I’ve seen it’s still open. Did you find any temporary solution to address it in the meantime?
I managed to make this work, but now I’m guessing how to do the opposite operantion, i.e. saving a definition to a file, in the same way as the save_as method in the Ruby API.
I loaded the definition into a new empty model, converted it to an Entity, changed some attributes and reconverted it to a new Component Definition. I checked that everything went well, but I don’t know how to save this definition to a file, other than saving the whole model with the definition inside. Is it possible at all?