Changing CPlanes makes GH unresponsive

Hi,

I need to regularly change between the default CPlane and a custom CPlane from within GH, so i made a small script to execute the change between cplanes. After execution both Rhino and Grasshopper become unresponsive (they do not freeze!). My first guess was a still open command in the Rhino cmd-line, but this was not the case.

SystemInfo

Rhino 8 SR21 2025-7-7 (Rhino 8, 8.21.25188.17001, Git hash:master @ 2e05bb7e11ec03aa58cc543d92330d59df05d32b)
License type: Educational Lab License, build 2025-07-07
License details: Cloud Zoo

Windows 11 (10.0.26100 SR0.0) or greater (Physical RAM: 64GB)
.NET 8.0.19

Computer platform: DESKTOP

Standard graphics configuration.
Primary display and OpenGL: NVIDIA Quadro P2000 (NVidia) Memory: 5GB, Driver date: 4-12-2025 (M-D-Y). OpenGL Ver: 4.6.0 NVIDIA 576.02

Accelerated graphics device with 4 adapter port(s)

  • Secondary monitor attached to adapter port 0
  • Windows Main Display attached to adapter port 1

OpenGL Settings
Safe mode: Off
Use accelerated hardware modes: On
GPU Tessellation is: On
Redraw scene when viewports are exposed: On
Graphics level being used: OpenGL 4.6 (primary GPU’s maximum)

Anti-alias mode: 4x
Mip Map Filtering: Linear
Anisotropic Filtering Mode: High

Vendor Name: NVIDIA Corporation
Render version: 4.6
Shading Language: 4.60 NVIDIA
Driver Date: 4-12-2025
Driver Version: 32.0.15.7602
Maximum Texture size: 32768 x 32768
Z-Buffer depth: 24 bits
Maximum Viewport size: 32768 x 32768
Total Video Memory: 5 GB

Rhino plugins that do not ship with Rhino

Rhino plugins that ship with Rhino
C:\Program Files\Rhino 8\Plug-ins\Commands.rhp “Commands” 8.21.25188.17001
C:\Program Files\Rhino 8\Plug-ins\rdk.rhp “Renderer Development Kit”
C:\Program Files\Rhino 8\Plug-ins\RhinoRenderCycles.rhp “Rhino Render” 8.21.25188.17001
C:\Program Files\Rhino 8\Plug-ins\rdk_etoui.rhp “RDK_EtoUI” 8.21.25188.17001
C:\Program Files\Rhino 8\Plug-ins\NamedSnapshots.rhp “Snapshots”
C:\Program Files\Rhino 8\Plug-ins\MeshCommands.rhp “MeshCommands” 8.21.25188.17001
C:\Program Files\Rhino 8\Plug-ins\IronPython\RhinoDLR_Python.rhp “IronPython” 8.21.25188.17001
C:\Program Files\Rhino 8\Plug-ins\RhinoCycles.rhp “RhinoCycles” 8.21.25188.17001
C:\Program Files\Rhino 8\Plug-ins\Grasshopper\GrasshopperPlugin.rhp “Grasshopper” 8.21.25188.17001
C:\Program Files\Rhino 8\Plug-ins\Toolbars\Toolbars.rhp “Toolbars” 8.21.25188.17001
C:\Program Files\Rhino 8\Plug-ins\3dxrhino.rhp “3Dconnexion 3D Mouse”
C:\Program Files\Rhino 8\Plug-ins\Displacement.rhp “Displacement”
C:\Program Files\Rhino 8\Plug-ins\SectionTools.rhp “SectionTools”

Is there any better solution?

cplanes_mwe.gh (6.9 KB)

Your code doesn’t make my GH unresponsive…

Setting CPlane via command ask you 3 points, but you are giving it vectors… that’s wrong, but also trick to fix.
Much easier to use https://developer.rhino3d.com/api/rhinocommon/rhino.display.rhinoviewport/setconstructionplane

In c# is:

    private void RunScript(Plane plane, bool execute, ref object a)
    {
        if(execute){
            this.RhinoDocument.Views.ActiveView.ActiveViewport.SetConstructionPlane(plane);
        }
    }