RhinoCommon C# Recognize ObjectType


this is a pretty basic question, but what would be the easiest option to recognize the ObjectType? (using RhinoObject or ObjRef as input)?

I don`t see anything in the Attributes…I could check for every possible type:

var curve = gc.Object(i).Curve();
if (null != curve)
I guess I have a curve

But that seems a bit much…?


RhinoObject has an ObjectType property that reveals objects ObjectType enum. If you’re prompting the user to pick some objects its often less effort to setup a geometry filter on the GetObject so that you can easier filter and inspect the results.


1 Like

Hi @dimcic

The as keyword is very useful.


– Dale