C# Geometry Output Diagnostic: Minimal Sphere Test

C# Geometry Output Diagnostic: Minimal Sphere Test
I am attempting to diagnose an issue where certain C# components execute successfully in Grasshopper but fail to output any geometry to the Rhino viewport. I have created a minimal test case and would appreciate it if others experiencing similar problems could replicate this to confirm if this issue is system-specific or widespread.

The Setup
Please place two components on a fresh Grasshopper canvas:

Number Slider: Name it R and set its value to 10.000.

C# Script Component:

Set the input name to R (double-click the input grip).

Set the output name to Output (double-click the output grip).

Connect the R slider output to the R C# input.

The Code to Paste
Double-click the C# component, delete the existing code, and paste only the following lines inside the RunScript function. This code attempts to generate a single sphere with radius R and output it as a BRep.

C#

void RunScript(double R, ref object Output)
{
// Simple Test: Generate a sphere and output it.
Output = new Rhino.Geometry.Sphere(Rhino.Geometry.Plane.WorldXY, R).ToBrep();
}
The Failure Result (The Key Observation)
After closing the C# Script Editor, the component should re-run.

Observation: The C# component executes and turns Grey.

Critical Failure Check: Go to the Rhino viewport and execute the Zoom Extents command.

If you are experiencing the issue I am seeing, the result will be:

Component Status: The C# component is Grey (no syntax errors).

Rhino Viewport: NO Sphere geometry appears.

If you observe this behavior, please reply to this thread. This failure confirms a fundamental blockage preventing C# components from sending geometry to the Rhino display, even when the code compiles successfully.

I’m not experiencing this issue, but would be interesting to check what is the output in “Output” when no sphere is shown on the Rhino viewport

Hello

when you see a bug, I think you must provide some more information to Mc Neel,

inno: You are right, I should have highlighted it better! The panel connected to the C# component’s Output parameter just reads [10]. That is the input radius being passed out.

The key finding is that no error messages or debug text of any kind are being generated. The component runs successfully and accepts the input, but the actual geometry output (the sphere) is blocked from leaving the ‘B’ output variable and displaying in the viewport. The component itself turns grey as if it’s struggling to draw the geometry. So I’m sort of lost.

Laurent: I appreciate the link to the official tech support checklist. If the community can’t pinpoint the cause for this strange geometry blockage, I will definitely follow those instructions and prepare a clean 3DM file and a screen recording for a formal bug report.

System info will surely be asked by Mc Neel.

So it will give version rhino 8 or wip

Mac or pc

Are drivers up to date …

Thanks Laurent, those are all great points to check!

Here is my system information in case it helps:

Rhino Version: I am running the latest stable release, Rhino 8 SR25 (8.25.25328.11001).

OS: I’m on Windows (Windows 10).

Drivers: I just updated my NVIDIA GeForce RTX 3070 drivers an hour ago, so they should be completely current.

Hopefully, knowing these details helps narrow down why the C# component is blocking the geometry output!

It is unclear what code is in your c# node. Here it works fine in Rhino 9 WIP.

If you post code again, please format it.

// Grasshopper Script Instance

#region Usings

using System;

using System.Linq;

using System.Collections;

using System.Collections.Generic;

using System.Drawing;


using Rhino;

using Rhino.Geometry;


using Grasshopper;

using Grasshopper.Kernel;

using Grasshopper.Kernel.Data;

using Grasshopper.Kernel.Types;

#endregion


public class Script_Instance : GH_ScriptInstance

{

    #region Notes

    /* 

      Members:

        RhinoDoc RhinoDocument

        GH_Document GrasshopperDocument

        IGH_Component Component

        int Iteration


      Methods (Virtual & overridable):

        Print(string text)

        Print(string format, params object[] args)

        Reflect(object obj)

        Reflect(object obj, string method_name)

    */

    #endregion


    private void RunScript(double R, ref object Output)

        {

        // Simple Test: Generate a sphere and output it.

        Output = new Rhino.Geometry.Sphere(Rhino.Geometry.Plane.WorldXY, R).ToBrep();

        }

}

sphere_c.gh (6.1 KB)

When sharing your System Info, I think the developers would want the entire report. I usually copy paste with the Hide details option but I think they prefer a *.txt file

System Info

Rhino 9 SR0 2025-11-25 (Rhino WIP, 9.0.25329.12305, Git hash:master @ 94aabd9816971918af23c4e9a3978c27952e558c)
License type: Commercial, build 2025-11-25
License details: Cloud Zoo
Expires on: 2026-01-09

Windows 11 (10.0.26200 SR0.0) or greater (Physical RAM: 128GB)
.NET 9.0.11

Computer platform: DESKTOP

Standard graphics configuration using DirectX
Primary display: NVIDIA RTX A5000 (NVidia) Memory: 24GB, Driver date: 10-29-2025 (M-D-Y). DirectX(11)

Accelerated graphics device with 4 adapter port(s)

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

Secondary graphics devices.
NVIDIA Quadro K2200 (NVidia) Memory: 4GB, Driver date: 10-29-2025 (M-D-Y).

Accelerated graphics device with 4 adapter port(s)

  • There are no monitors attached to this device!

DirectX Settings
Safe mode: Off

OpenBLAS: OpenBLAS 0.3.29 DYNAMIC_ARCH NO_AFFINITY Zen MAX_THREADS=64.

Rhino plugins that do not ship with Rhino

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

systeminfo_martinsiegrist.txt (2.3 KB)

PS: in your instructions above, it says double click the input grip. I guess that’s just a mistake and you understand that renaming an input is done with a right click on the input name.

I wanted to provide the final update on the C# component issue. It turns out the problem was my mistake as a novice C# user: I was only pasting the body of the RunScript function, which caused a compilation failure when trying to output the geometry.

The C# component requires the full code template (including all the necessary using statements and class structure) to reliably compile and execute the geometry output. Once I pasted the complete, correct code template, the sphere appeared perfectly in Rhino.

Sorry for any confusion this caused, and thanks for the help!


PS: I also tried this in WIP which obviously worked as well.

With a file we could have seen this at the beginning of this discussion.

2 Likes