I’m still not sure I understand. Especially the term “canvas” isn’t clear. I don’t think there is such a term in SU. There is a model were you can create a geometries, groups and components or insert a component.
You can load a file as component definition then insert instance to the entities collection.
Then you can compare it to the other component instance. If I understand right the your method will create a component instance:
created_instance = Create_Product("product1")
There are two methods come into my mind to compare this instances. (the
created_instance vs. inserted “model” as component instance )
As far as I know in Ruby, you can not compare it unless both are loaded to the model.
However there is a SketchUp C API could be that you are looking for.
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.
Unfortunately I have no experience with it at all
Maybe someone (other forum member) can help!