REALLY Stupid C# Question

I’m writing a component which creates some new geometry. Right now it’s written based only on the WorldXY plane but I want the user to be able to input the initial base plane. So I’m trying to create a Transform to apply. But I always get the same error. And this is a dumb and simple C# error, but I can’t find any solution. I have tried both ChangeBasis and PlaneToPlane, but either way I get an error in the form of

Type name ‘ChangeBasis’ does not exist in the type ‘Transform’


Type name ‘PlaneToPlane’ does not exist in the type ‘Transform’

When I go to the Definition in VS, both ChangeBasis and PlaneToPlane are clearly listed. I am using Rhino.Geometry. and when I don’t add the “type,” but input the base and target planes it tells me that Transform doesn’t contain any methods with two overloads.

This is really a dumb, noob question. But I seem to be missing something fundamental - and I’ve gotten pretty far in C# without having run into this before. Thanks in advance for any help.

Something like that must work, PlaneToPlane is a static method

Plane planeTo;
Plane planeFrom
Transform transform = Transform.PlaneToPlane(planeFrom, planeTo);


1 Like

Hi Laurent, thank you for your extremely speedy solution. But yeah - it’s just throwing this really dumb error. It’s not that it doesn’t realize the base or target planes - I even just tried a method where I constructed two planes from scratch in the script to test it rather than rely on the Rhino Geometry type WorldXY and it is still the exact same problem. It doesn’t want to take any “methods” after Transform. And like I said, if I go to the source in the Rhino.Geometry namespace, the other methods are clearly there…

Please post your code and also what version of the Rhino api you are using.

Hi Michael, thanks for the speedy response. How do I find my API version?

It will be whatever version of Rhino you are using to develop with.

Ah, well what’s installed on this computer is 6.21.19351.9141

For the code, I can’t post the whole thing (in progress, not ready to share, a lot of things that will really cloud the issue) but the relevant parts are:

using System;
using System.Collections.Generic;

using Grasshopper.Kernel;
using Grasshopper.Kernel.Data;
using Grasshopper.Kernel.Parameters;
using Rhino.Geometry;

public class Foo
        public static Plane basePlane;     // Base Plane

protected override void RegisterInputParams(GH_Component.GH_InputParamManager pManager)
    pManager.AddPlaneParameter("Base Plane", "P", "Base Plane for new Foo", GH_ParamAccess.item, Plane.WorldXY);
    protected override void SolveInstance(IGH_DataAccess DA)
        DA.GetData(0, ref Foo.basePlane);

// irrelevant
// irrelevant
// irrelevant

        Transform changeBasePlane = new Transform.ChangeBasis(Plane.WorldXY, Foo.basePlane);

And like I said, the error is

“Type name ‘ChangeBasis’ does not exist in the type ‘Transform’”


The problem is you are using the “new” keyword. “new” is for construction methods.

1 Like

Oh - it literally was THAT dumb. That makes perfect sense.
I can’t believe I wasted everyone’s time with something that dumb.


Guess it’s time to get some rest, yeah?


Don’t rest! Keep on coding! :sunglasses:

1 Like

Thank you, @rawitscher-torres - with that (really stupid one) solved, I’ve moved on to better, thornier problems. I can’t wait to share what I’ve been cooking up.