2027 Class
Changes 0
C

LightGroupManager

Description:
This class represents a set of light groups that are used for easier management of various lighting scenarios
Inheritance Hierarchy:
System.Object
  Autodesk.Revit.DB.Lighting.LightGroupManager
public class LightGroupManager : IDisposable
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);
}
Name Return Type Description Inherited From
M CreateGroup(String) LightGroup Create a new LightGroup object with the given name
M DeleteGroup(ElementId) None Remove the given LightGroup object from the set of LightGroup objects
M Dispose() None Releases all resources used by the LightGroupManager
M Equals None Determines whether the specified object is equal to the current object. (Inherited from Object ) Object
M GetGroups() IList<LightGroup> Get the set of contained LightGroup objects The set of LightGroup objects
M GetHashCode None Serves as the default hash function. (Inherited from Object ) Object
M GetLightDimmer(ElementId, ElementId) Double Gets the dimmer value for the given light for rendering the given view
M GetLightGroupManager(Document) LightGroupManager Creates a light group manager object from the given document
M GetType None Gets the Type of the current instance. (Inherited from Object ) Object
M IsLightGroupOn(ElementId, ElementId) Boolean Returns true if the given light group is on
M IsLightOn(ElementId, ElementId) Boolean Returns true if the given light is on for rendering the given view
M SetLightDimmer(ElementId, ElementId, Double) None Sets the dimmer value for the given light for rendering the given view
M SetLightGroupOn(ElementId, ElementId, Boolean) None Turns the given light group on or off for rendering the given view depending on the bool argument
M SetLightOn(ElementId, ElementId, Boolean) None Turns the given light on or off for rendering the given view depending on the bool argument
M ToString None Returns a string that represents the current object. (Inherited from Object ) Object
Name Return Type Description Inherited From
P IsValidObject Boolean Specifies whether the .NET object represents a valid Revit entity.