vcComponent.clone(0) method


inside the OnRun() of a PythonScript i need to duplicate a vcComponent the I use .clone(0) method.
During this when simulation run no cloned component is generated and I receive this message:

“Component creation is not allowed in this context”

Can someone help me to understand the reason of this error message?



Cloning is not allowed, but you are allowed to use vcApplication().createComponent(). I don’t remember the exact reason why, but something to do with saving memory without affecting performance and avoid issues where cloned geometry has to be shared by default.