Error accessing object data using RhinoGH Converters

Howdy, I’m back and working again on using the existing RhinoGh converters. I’ve managed to resolve my earlier issue with being able to import and invoke the code.

BUT, now I’m not sure I’m using it right. Is there some setup/config I need to do outside of new ConverterRhinoGh() in order to call ConvertToSpeckle() (or similar?).

(forgive the sloppy C#) For example, this code always returns null for a valid Rhino Circle:

And this code throws a classic “object reference not set to an instance of an object” in [External Code]:

The object in question always passes CanConvertToSpeckle, if that helps.

1 Like

You might need to call converter.SetContextDocument(Doc)

See: speckle-sharp/ConnectorRhino/ConnectorRhino/ConnectorRhinoShared/UI/ConnectorBindingsRhino.cs at 15f0a8c516b19ae86a6777bd68fcafb2a9ebf29a · specklesystems/speckle-sharp · GitHub

1 Like

That was it, thank you mountains!

Nothing thrilling yet, but that’s a speckle circle we’re looking at. A few things to wrap my head around (units, C# business, detch-or-not) but the important loop has been figured out and everything feels possible.

4 Likes

:heart_eyes:

Post must be at least 20 characters.

1 Like