How can we have a component as code inside our plugin?

Your Extension with have its own dedicated subfolder.

Within that make a new subfolder named say ‘Compos’.
Put your SKP file[s] in there - remember that these must be saved as a version which will be compatible with the oldest version of SketchUp supported by your extension…

Now you can easily make a reference to that Compos folder and the component’s SKP you need.
You can then load that component’s SKP into your model.definitions - checking that it doesn’t already exist - e.g. the extension was run before and so it has already loaded the component…

Your array approach would only bloat your extension’s file size, when a separate SKP will suffice…

1 Like