Trying to use the InstanceDefinition.CreatePreviewBitmap method

I’m trying to retrieve the preview bitmap of an InstanceDefinition object from it’s name.
This is my best effort up to now (least amount of error messages if that can be considered an indicator :

Preview (3.2 KB)

Getting all mixed up with types and classes here, I guess…

Side question : how could I get the error messages in English ?
(My system is in French, but rhino is in English).

Enums you use like this:

var myProjection = Rhino.Display.DefinedViewportProjection.Perspective;
var myDisplayMode = Rhino.RhinoObjects.DisplayMode.Shaded;

The error messages come from the compiler, and that will always give localized messages as far as I know.

It works !
How could I have guessed this from the Rhinocommon documentation ?

Little snippets of sample code as you gave me go a long way.
Ahh… the good days of the Rhinoscript documentation…

Well, that was just basic C# knowledge. C# Enums

There’s many ways to understand the “basics” as you say.
One is through examples ; it worked out quite well with Rhinoscript.

Couldn’t little samples of code be auto-generated and added to the Rhinocommon documentation ?