generative modeling for Rhino
I've noticed that the "doc" variable in scripting components does not update when a new Rhino document is opened. This can be worked around by defining one's own reference to Rhino.RhinoDoc.ActiveDoc but it would be nice to be able to rely on the predefined "doc" reference.
I changed the code so that the doc is set just before every call to RunScript. The script won't run again when the document changes, but at least is should never run with the wrong document.