I wonder if somebody could give me some general information about the scriptcontext module.
particularly I didn’t understand what is the difference in using (for example) a function like
scriptcontext.doc.Objects.AddText(…) and the other one rhinoscriptsyntax.AddText(…).
I noticed that scriptcontext.doc.Objects methods are a subset of rhinoscriptsyntax functions. But I am not able to figure out what exactly is the purpose of scriptcontext module.
Thank you very much
The way I understand it, is that it forms a bridge between RhinoCommon and Rhino. This means you can create (following your example) text in Rhino common without adding it to the Rhino document and then later you can choose to add the text to the Rhino doc using scriptcontext.doc.Objects.AddText.
Rhinoscriptsyntax is basically mimicking rhinoscript where AddText will not only create but also add things to the Rhino doc so it’s more like doing the above ‘behind the scenes’. But then you don’t have the choice to add things to the doc or not.
The reason this is useful is because you often want to create geometry that doesn’t need to be added to the doc (yet) when it is created.
Hope the above makes sense.