scriptcontext is a reference to the active document, it’s objects and attributes. Thus most of the functions can be found in classes like Rhino.Display, Rhino.DocObjects, Rhino.DocObjects.Tables, etc.
For example sc.doc.Views.ActiveView.ActiveViewport
Rhino.RhinoDoc.ActiveDoc.Views references the current document’s view table, all of the methods and properties for dealing with those can be found under Rhino.Display.RhinoViewport… It’s a little hard to find your way around at the beginning.
I use the online SDK as a reference, but it’s also all in the editor left sidebar.
A handy tool I made is below - it will save a text file with all the subdirectories (subclasses?) of a particular class… For example, to see what’s in scriptcontext.doc.Objects you would run the following:
import rhinoscriptsyntax as rs
import scriptcontext as sc
iClass=sc.doc.Objects
direc=dir(iClass)
def ExportClassDirectory(direc):
filter = "Text File (*.txt)|*.txt|All Files (*.*)|*.*||"
filename = rs.SaveFileName("Save directory as", filter)
if not filename: return
namext=filename.split("\\")
name=namext[-1].split(".")
file=open(filename,"w")
file.write(name[0]+"\n\n")
for item in direc:
file.write(item+"\n")
file.close()
ExportClassDirectory(direc)