I’m not the finest expert on the matter, but my amateur interpretation is that scriptcontext is the “bridge” between Python/RhinoCommon and the active document. You use it to access objects that are already in the document as well as add new ones. You can also access and modify any other document related items - tolerances, views, etc. Most of what’s in there can be found in the Rhino.DocObjects Namespace.
To see what subdirectories are under something like scriptcontext.doc, I use a script to write out a text file:
import rhinoscriptsyntax as rs
import scriptcontext as sc
filter = "Text File (*.txt)|*.txt|All Files (*.*)|*.*||"
filename = rs.SaveFileName("Save directory as", filter)
if not filename: return
for item in direc:
I guess I should add that I usually use the autocomplete to get where I want to go, my most often used are:
sc.doc.Objects(Add, Find, etc)
sc.doc.Model… (file tolerances)