Hi, I would like to ask which is the clearest way to create a new custom component in the canvas.
I found two options.
The fist one is
Here I am missing returned instance of the created object. I would like to work with it further. Maybe possibility to use InstanceGUID instead of ComponentGUID can solve it.
(I have been thinking to just take the last added object by Doc.Object[Object.Count-1], but it doesn’t seems correct and robust enough.)
Is it possible to get instance object of the created component?
How I can use
init_code, can you show me some example?
The second option I found is
Document.AddObject() where instance of the custom component can be used directly.
Comparing this method with the previous one, this method seems to be low_level, which means, that is missing some important functions.
Are there any important methods what have to be called (e.q. validCanvas, undoFunction, autoSave)?
Are there any differences if I will use
ComponentServer.EmitObject()method or just create a