Running a command after a scripted Grasshopper Player

Hi¡ I’m having problems executing a command after the Grasshopper Player execution.
Currently, I have this:


!_-RunPythonScript (
import rhinoscriptsyntax as rs

gh = rs.GetPlugInObject("Grasshopper")
if not gh.IsEditorLoaded():
    rs.Command("_Grasshopper")
)
_-RunPythonScript (
import Grasshopper
import scriptcontext as sc
import Rhino

sc.sticky["unidades"] = Rhino.RhinoDoc.ActiveDoc.ModelUnitSystem
Grasshopper.Instances.DocumentEditor.Hide()
Grasshopper.Instances.DocumentEditorFadeOut()
)
_-GrasshopperPlayer "G:\Unidades compartidas\Biblioteca\Rutinas Grasshopper\GHP\Released\GHP_AutoVase.gh"

I store the current model units in the sticky dict, then is changed in the grasshopper script. I want to add another command line in the macro editor so it restores the original model units.

I have tried this, with no success:


!_-RunPythonScript (
import rhinoscriptsyntax as rs

gh = rs.GetPlugInObject("Grasshopper")
if not gh.IsEditorLoaded():
    rs.Command("_Grasshopper")
)
_-RunPythonScript (
import Grasshopper
import scriptcontext as sc
import Rhino

sc.sticky["unidades"] = Rhino.RhinoDoc.ActiveDoc.ModelUnitSystem
Grasshopper.Instances.DocumentEditor.Hide()
Grasshopper.Instances.DocumentEditorFadeOut()
)
_-GrasshopperPlayer "G:\Unidades compartidas\Biblioteca\Rutinas Grasshopper\GHP\Released\GHP_AutoVase.gh"

_-RunPythonScript (
import Grasshopper
import scriptcontext as sc
import Rhino

Rhino.RhinoDoc.ActiveDoc.ModelUnitSystem = sc.sticky["unidades"]
) 

Any ideas?

Thank You¡