Rhinocommon File3dmObject Type

Hi,
a short question here. If I select a RhinoObject from the Object table, I can easily check if I selected a block, for example:

if (obj is InstanceObject iref)

This works because InstanceObject is derived from the RhinoObject. However, if I want to do the same thing (check the type of the object the user selected) when I am reading directly from the 3dm file…there doing it with the File3dmObject does not work:

Any suggestions?
Thanks!

Hi @dimcic , you can check it this way

foreach(File3dmObject obj in file3dm.Objects)
            {
                if(obj.Geometry is InstanceReferenceGeometry instanceReference)
                {

                }
            }
1 Like