Click or drag to resize
ObjectEnumeratorSettingsIncludeLights Property

[Missing <summary> documentation for "P:Rhino.DocObjects.ObjectEnumeratorSettings.IncludeLights"]

Namespace: Rhino.DocObjects
Assembly: RhinoCommon (in RhinoCommon.dll) Version: 5.1.50000.0 (5.0.20693.0)
Syntax
public bool IncludeLights { get; set; }

Property Value

Type: Boolean
Examples
using Rhino;
using Rhino.Commands;
using Rhino.DocObjects;

namespace examples_cs
{
  public class ObjectEnumeratorCommand : Command
  {
    public override string EnglishName
    {
      get { return "csObjectEnumerator"; }
    }

    protected override Result RunCommand(RhinoDoc doc, RunMode mode)
    {
      var object_enumerator_settings = new ObjectEnumeratorSettings();
      object_enumerator_settings.IncludeLights = true;
      object_enumerator_settings.IncludeGrips = false;
      var rhino_objects = doc.Objects.GetObjectList(object_enumerator_settings);

      int count = 0;
      foreach (var rhino_object in rhino_objects)
      {
        if (rhino_object.IsSelectable() && rhino_object.IsSelected(false) == 0)
        {
          rhino_object.Select(true);
          count++;
        }
      }
      if (count > 0)
      {
        doc.Views.Redraw();
        RhinoApp.WriteLine("{0} object{1} selected", count,
          count == 1 ? "" : "s");
      }
      return Result.Success;
    }
  }
}
from Rhino import *
from Rhino.DocObjects import *
from Rhino.Commands import *
from scriptcontext import doc

def RunCommand():
  object_enumerator_settings = ObjectEnumeratorSettings()
  object_enumerator_settings.IncludeLights = True
  object_enumerator_settings.IncludeGrips = False
  rhino_objects = doc.Objects.GetObjectList(object_enumerator_settings)

  count = 0
  for rhino_object in rhino_objects:
    if rhino_object.IsSelectable() and rhino_object.IsSelected(False) == 0:
      rhino_object.Select(True)
      count += 1;

  if count > 0:
    doc.Views.Redraw()
    RhinoApp.WriteLine("{0} object{1} selected", count,
      "" if count == 1 else "s")

  return Result.Success

if __name__ == "__main__":
  RunCommand()
See Also