Skip to content

Commit

Permalink
fixed __rhinodoc__ access
Browse files Browse the repository at this point in the history
  • Loading branch information
eirannejad committed Jun 15, 2022
1 parent 8c3d46e commit eed41ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions python3/scriptcontext.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions tools/convert_py2to3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)",
Expand Down

0 comments on commit eed41ff

Please sign in to comment.