diff --git a/python3/scriptcontext.py b/python3/scriptcontext.py index ba05521..1113256 100644 --- a/python3/scriptcontext.py +++ b/python3/scriptcontext.py @@ -1,10 +1,10 @@ # scriptcontext module -# import RhinoPython.Host as __host +import Rhino '''The Active Rhino document (Rhino.RhinoDoc in RhinoCommon) while a script is executing. This variable is set by Rhino before the exection of every script. ''' -doc = __rhinodoc__ +doc = Rhino.RhinoDoc.ActiveDoc '''Identifies how the script is currently executing diff --git a/tools/convert_py2to3.py b/tools/convert_py2to3.py index 99af24a..c72e0cc 100644 --- a/tools/convert_py2to3.py +++ b/tools/convert_py2to3.py @@ -92,9 +92,9 @@ def scriptcontext_fixes(item): """Fix misc items in scriptcontext.py""" with SourceFile(item) as sf: sf.replace( - "import RhinoPython.Host as __host", "# import RhinoPython.Host as __host" + "import RhinoPython.Host as __host", "import Rhino" ) - sf.replace("doc = None", "doc = __rhinodoc__") + sf.replace("doc = None", "doc = Rhino.RhinoDoc.ActiveDoc") sf.replace( "rc = __host.EscapePressed(reset)", "rc = None # __host.EscapePressed(reset)",