LightGroupManager Class

This class represents a set of light groups that are used for easier management of various lighting scenarios
Inheritance Hierarchy
SystemObject
  Autodesk.Revit.DB.LightingLightGroupManager

Namespace: Autodesk.Revit.DB.Lighting
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public class LightGroupManager : IDisposable

The LightGroupManager type exposes the following members.

Properties
 NameDescription
Public propertyIsValidObject Specifies whether the .NET object represents a valid Revit entity.
Top
Methods
 NameDescription
Public methodCreateGroup Create a new LightGroup object with the given name
Public methodDeleteGroup Remove the given LightGroup object from the set of LightGroup objects
Public methodDisposeReleases all resources used by the LightGroupManager
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Public methodGetGroups Get the set of contained LightGroup objects The set of LightGroup objects
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetLightDimmer Gets the dimmer value for the given light for rendering the given view
Public methodStatic memberGetLightGroupManager Creates a light group manager object from the given document
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodIsLightGroupOn Returns true if the given light group is on
Public methodIsLightOn Returns true if the given light is on for rendering the given view
Public methodSetLightDimmer Sets the dimmer value for the given light for rendering the given view
Public methodSetLightGroupOn Turns the given light group on or off for rendering the given view depending on the bool argument
Public methodSetLightOn Turns the given light on or off for rendering the given view depending on the bool argument
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Top
Example
public void AddRemoveLightGroupInManager(Document document, FamilyInstance lightOne, FamilyInstance lightTwo)
{
    if (document.IsFamilyDocument)   // it supports project document only.
        return;
    LightGroupManager groupMgr = LightGroupManager.GetLightGroupManager(document);

    // Add a light group with a light
    LightGroup lightGroup = groupMgr.CreateGroup("Group_One");
    lightGroup.AddLight(lightOne.Id);
    // Add another light group with another light.
    lightGroup = groupMgr.CreateGroup("Group_Two");
    lightGroup.AddLight(lightTwo.Id);

    // Retrieve the added light group in the manager.
    IList<LightGroup> existingGroups = groupMgr.GetGroups();
    foreach (LightGroup group in existingGroups)
    {
        string groupName = group.Name;
    }

    // Remove one light group from the manager.
    groupMgr.DeleteGroup(existingGroups[0].Id);
}
See Also