ObjectEnumeratorSettings ClassTypeFilter For Rhino.Geometry.TextEntity

Hi everyone,

I want to get objects that are TextEntity (excluding other annotations like linearDimension etc). Currently, there is only the ObjectType for Annotation.

I noticed that there are two different properties for ObjectEnumeratorSettings: ClassTypeFilter/ObjectTypeFilter. Can I use the ClassTypeFilter to do this?

Also, there’re three methods for GetObjectList:

  1. GetObjectList(Type)
  2. GetObjectList(ObjectEnumeratorSettings)
  3. GetObjectList(ObjectType)

Is there any example code for the first method? I don’t quite get what “Type” means here.

Much Appreciated!

Hi @vincentfs,

Keep in mind that TextEntity is type of geometry. If your looking for document objects, then you need to search for TextObject.

protected override Result RunCommand(RhinoDoc doc, RunMode mode)
{
  var rh_objects = doc.Objects.GetObjectList(typeof(TextObject));
  foreach (var rh_obj in rh_objects)
  {
    if (rh_obj is TextObject text_obj)
      RhinoApp.WriteLine(text_obj.TextGeometry.PlainText);
  }
  return Result.Success;
}

– Dale

1 Like